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 is jQuery plugin and what is the advantage of using plugin?
How to check if number is numeric while using jQuery 1.7+?
What is jquery selectors?
What are the selectors in jquery? How many types of selectors in jquery?
What is the use of delegate() method in jquery?
Mention the differences between javascript and jquery.
Is jquery html() method works for both html and xml documents?
What is the basic requirement to start with the jquery?
Explain the concepts of "$ function" in jquery with an example?
What is jQuery UI?
What is a cdn? : jQuery Mobile
Difference between document.ready and window.onload? : jQuery Mobile