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 search for descendant elements that match the specified selectors using ?
What is jquery mobile theming? : jquery mobile
Define type paremeter of jquery ajax method?
How to use jquery.connect?
What are the slow selectors in jquery? : jquery mobile
What is the difference between $.map and $.grep in jQuery?
How to call a method inside code-behind using jquery?
What is the starting point of code execution in jquery?
What are the guidelines for an application to follow the principles of progressive enhancement.
What are selectors in jQuery and how many types of selectors are there?
And finally, if you could give one tip to any new budding jquery ui developers, what would it be?
How to get the direct parent of an element using ?