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 get the current offset of the first matched element, in pixels, relative to the document using ?
How do you stop the currently-running animation?
What is normally not included in a cloned copy? : jQuery Mobile
What does dollar sign ($) means in jQuery?
How can events be prevented to work after an ajax request?
How do you stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements?
Explain the common methods of sending a request to a server.
What is jquery.noconflict? Explain
What is queue() in jquery? Use of queue() in jquery?
Why html 5 inputs look different across devices and browsers? : jquery mobile
Tell me does jquery 2.0 supports ie? : jquery mobile
Can you please explain the difference between event.preventdefault and "return false"? : jquery mobile