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 jQuery plugin and what is the advantage of using plugin?

1 Answers  


How to check if number is numeric while using jQuery 1.7+?

1 Answers  


What is jquery selectors?

0 Answers  


What are the selectors in jquery? How many types of selectors in jquery?

0 Answers  


What is the use of delegate() method in jquery?

0 Answers  






Mention the differences between javascript and jquery.

0 Answers  


Is jquery html() method works for both html and xml documents?

0 Answers  


What is the basic requirement to start with the jquery?

0 Answers  


Explain the concepts of "$ function" in jquery with an example?

0 Answers  


What is jQuery UI?

2 Answers  


What is a cdn? : jQuery Mobile

0 Answers  


Difference between document.ready and window.onload? : jQuery Mobile

0 Answers  


Categories