views:

305

answers:

3

There are some things accross these which I'd like to use. I hope they've choosen clever naming conventions to prevent collisions with all their functions and classes? Does anyone use all these at once in one site?

+2  A: 

It is possible to use mootools and jquery together, or jquery and prototype together simply by using jQuery.noConflict(). Using all three together might be a stretch as I don't believe that Prototype and Mootools have a no conflict mode and both define $. However, there is this article that talks about using $ safely in Mootools, which might be able to solve your problems.

Justin Johnson
+1  A: 

Mootools and Prototype both extend native javascript objects such as String and Array. I don't think there is any way you can make both of them work together without some conflict.

However, jQuery defines only a single global $ object which it can let go if you use the noConflict mode. You'd then be using the jQuery object.

Chetan Sastry
they've got obviously a great design!
openfrog
+4  A: 

Whilst it can be done (with noConflict), there are still potential conflicts.

For example jQuery adds a unique ID to element nodes it touches, which it expects to manage. If you remove such elements through a means other than jQuery you can get a memory leak; if you clone them from another framework (or DOM calls), you can confuse jQuery with subtle and weird results. There are also many potential interactions between the event models of the frameworks, especially live in jQuery.

If you keep the elements touched by each framework entirely separate, you might be able to get away with it. But really, I wouldn't recommend it. If at all possible, keep the number of frameworks used by your pages between zero and one.

bobince
+1 great, great answer. I didn't realize the potential problems go this deep.
Pekka
honestly, I expected just that ;) ...big problems. oh man. too bad. it's like you have to choose between wearing only a left sock, or a right sock. What's better? Gonna spend days on that decision.
openfrog