What is jQuery.noConflict?
Answer / chaitanya
As other client side libraries like MooTools, Prototype can be used with jQuery and they also use $() as their global function and to define variables. This situation creates conflict as $() is used by jQuery and other library as their global function. To overcome from such situations, jQuery has introduced jQuery.noConflict().
Hide Copy Code
jQuery.noConflict();
// Use jQuery via jQuery(...)
jQuery(document).ready(function(){
jQuery("div").hide();
});
You can also use your own specific character in the place of $ sign in jQuery.
Hide Copy Code
var $j = jQuery.noConflict();
// Use jQuery via jQuery(...)
$j(document).ready(function(){
$j("div").hide();
});
| Is This Answer Correct ? | 0 Yes | 0 No |
What is jquery selectors?
What is the difference between find and children methods?
How to validate email using jquery?
Is it possible to use other client side libraries like MooTools, Prototype along with jQuery?
What is jQuery connect?
What are the features of jquery used in web applications?
What is a use of jquery filter?
What is the difference between calling stop(true,true) and finish method?
How to check variable is empty or not in jquery?
What is the use of delegate() method in jquery?
Which is the latest version of jQuery library?
How to control page titles in jquery mobile? : jquery mobile