What is jQuery.noConflict?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Can jquery be used to make an ajax request?

452


And finally, if you could give one tip to any new budding jquery ui developers, what would it be?

496


What is the difference between jquery.get() and jquery.ajax()?

460


Differentiate between calling stop (true, true) and finish method?

494


How can images be made to appear scrolling one over another?

449






How to fetch the values of selected checkbox array using jquery?

476


What are the approaches of extracting a query string with regular expressions?

406


Tell me how to select combobox select value and text using jquery?

428


How to revert the most recent ‘destructive’ operation, changing the set of matched elements to its previous state using ?

462


What is method chaining in jquery and what are the advantages?

425


What is the difference between jquery and javascript?

457


Can you give me a brief history of your programming days? Where did it all start?

593


Explain the features of jquery mobile? : jquery mobile

429


Explain various methods to make ajax request in jquery? : jquery mobile

429


Where can we download JQuery?

478