jqueryexample.com jQuery .noConflict() method - jqueryexample.com

jQuery .noConflict() method by jqueryexample

If we are referring any other script files (MooTools, prototype.js,YUI ) along with jQuery you may get conflicts in the namespace between the two libraries.
Note: you need to use is jQuery’s .noConflict() method like this jQuery.noConflict(); before you write any jQuery code. jQuery will return $() to it’s previous owner .So we need to use jQuery() instead of $() function.
<script src="prototype.js"></script>
<script src="jquery.js"></script>
// Use jQuery via jQuery(...)
// Use Prototype with $(...), etc.

Did you like this? Share it:


No comments yet, be the first.

Leave a Comment