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 are the the two types of cdns?
How can you delay document.ready until a variable is set?
In what situation you would use multiple version of jQuery and how would you include them?
Can we select a element having a specific class in jquery ?
What is the difference between $(this) and 'this' in jquery?
When can you use jquery?
How to load a page using jquery mobile? : jquery mobile
How to use connect in jquery?
What is the difference between onload() and document.ready()?
Please tell us that is jquery knockkout intended to compete with jquery or prototype or work with it?
What is the use of jQuery.data() method?
What the use of $ symbol in jquery.