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 |
Is jQuery a programming language?
What were the biggest challenges of getting the 1.7 release out there?
What is the use of val() method in jquery?
Which one is more efficient, document.getElementbyId( "myId") or $("#myId)?
How to disable jquery animation? : jquery mobile
How do I pull a native DOM element from a jQuery object?
Is jquery is json library file or a javascript?
What is the difference between event.stopPropagation and event.stopImmediatePropagation?
How to debug jquery code/ debug jquery?
What are the differences between size and length in jquery?
What is cdn? Explain
What does the jQuery migrate function do?