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 use connect in jquery?
Explain animate function in jquery?
Is Uncaught TypeError: $(…).modal not a function jquery?
What is the difference between eq() and get() methods in jQuery?
Can there be more than one ready function in jquery?
what does $("div") will select? : jquery mobile
What is the use of toggle() method in jquery?
Describe the two types of cdns?
How to use migrate jquery plugin if possible? : jquery mobile
Mention some advantages of jquery.
Define the use of each function in jquery?
How to run an event handler only once in jQuery?