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 select class in jquery?
Why we use chaining in jquery?
What are selectors in jQuery and how many types of selectors are there?
How to select element having a particular class (".selected")?
Tell me what does $("div") will select? : jquery mobile
What are the guidelines for an application to follow the principles of progressive enhancement.
Explain the difference between .js and .min.js?
What are the slow selectors in jquery? : jquery mobile
What are the advantages of method chaining in jquery?
Which sign is used as a shortcut for jQuery?
How can we apply css in even childs of parent node using jquery library?
Difference between javascript and jquery?