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 |
How to read cookies in jquery?
How do you get the attribute of an html tag in jquery?
What is the basic need to start with jQuery?
What is chaining in jQuery?
Name some of the methods of jquery used to provide effects?
How can you get the type of arguments passed to a function?
Which are the fastest selectors in jquery? : jquery mobile
Define jquery $.ajax() method?
Tell me what does $("div") will select? : jquery mobile
What is slice() method in jquery?
Different ways of using $.connect function in jquery?
What is normally not included in a cloned copy? : jQuery Mobile