Make jQuery work on the same page with Mootools and or Prototype
javaScript,
jquery,
Mootools,
Prototype
on June 25, 2008
Some conflicts appear when using jQuery javascript library with Motools or Prototype on the same page. A workaround is using noConflict mode for jQuery.
Follow these steps:
1. Download the latest version of jQuery
2. Download jQuery compat
3. Open jquery.js, go to the end of the file and add this line jQuery.noConflict();
4. With jquery.js opened, open jquery.compat-1.0.js copy all it's content and paste-it after jQuery.noConflict(); line in jquery.js.
5. Find these lines and comment or delete them:
jQuery.fn._filter = jQuery.fn.filter; jQuery.fn.filter = function(arr){ return this._filter( arr.constructor == Array ? arr.join(",") : arr ); };
6. Open all .js files that use jQuery library and add as the first line (function($){ and as the last line })(jQuery);
(function($){ content of the .js file })(jQuery);
That's it.
Post new comment