Search code examples
jquerymootoolsprototypejsunobtrusive-javascript

how to prevent conflicts between mooTools and Prototype


I know that jQuery.noConflict() is used to avoid conflict between $ of any other library and jQuery.(i.e. Prototype) But lets say, by any chance I am using Prototype, MooTools and jQuery.In that case jQuery.noConflict() will work fine for jQuery and any other library combination, but then what with Prototype and MooTools, if they both use $, how come code /browser will identify it properly. Note:I have never worked with Prototype and MooTools , so I am sorry if my question doesn't make any sense.


Solution

  • If these other frameworks don't have something corresponding to the noConflict option, the last loaded of these frameworks will overwrite the definition of $ with their own, and the first loaded framework will be broken, if they both depend on $