I am working on a site where I have several JQuery scripts which all play nicely together. I need to add a script which uses mootools and now I am having problems due to a conflict. I have read a few articles but am totally lost as I can’t seem to get any of the noconflict suggestions to work. It may be due to my lack of understanding.
At the moment these are the JQuery scripts I am calling…
When you use jQuery.noConflict(), jQuery no longer uses the $ variable, so when you’re trying to call some things like $(document).ready() they will no longer work with jQuery’s $ variable.
Yes, it would be much more efficient to use one library only. However, I noticed yesterday that Mootools seems to have a verion now that plays nicely with other libraries.
Has it previously not? I was under the impression that if you would for example use jQuery and Mootools together and used jQuery.noConflict(), everything should be dandy as jQuery hands the $ variable back to whatever library originally created it.
I don’t think I’ve ever actually ran into this issue as I don’t tend to mix-and-match libraries
I’m not sure. But someone asked yesterday about which version of MooTools to donwload, and in comparing the versions I noticed that there was one that is so designed that it won’t cause conflicts with other libraries such as jQuery (meaning, I presume, that noConflict wouldn’t be needed). But I can’t claim to know much about this stuff. Still, if that is the case, it sounds neater than using noConflict.