What is jQuery.noConflict?






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

Post New Answer




More jQuery Interview Questions

What is the difference between find and children methods in jquery?

0 Answers  


Is Uncaught TypeError: $(…).modal not a function jquery?

0 Answers  


What are the popular jquery cdn? : jquery mobile

0 Answers  


Tell me what does dollar sign ($) means in jquery? : jquery mobile

0 Answers  


What are the effects methods used in jquery?

0 Answers  






Explain the difference between .js and .min.js? : jquery mobile

0 Answers  


Explain why there are two different version of jquery library? : jquery mobile

0 Answers  


Tell me what is the use of .size() method in jquery?

0 Answers  


List browser related issues for jquery?

0 Answers  


In what scenarios jQuery can be used?

0 Answers  


How can we give face effect in jquery?

0 Answers  


List the basic selectors in jquery?

0 Answers  






Categories