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
How to work with jQuery parent(), children() and siblings()?
How to get the value of selected option in jquery?
What is the use of css() method in jquery?
How can we apply css in last child of parent using jquery library?
How can jquery be used in conjunction with another javascript library that also uses $ for naming?
What are the differences between size and length in jquery?
How we can select multiple elements in jquery?
Mention the differences between javascript and jquery.
What is the difference between text() and html() in jquery?
How we can modify the css class in jquery?
What are the difference between empty(), remove() and detach() functions in jquery?
List browser related issues for jquery?
What are the slow selectors in jquery? : jquery mobile
What is the need for jquery? : jQuery Mobile
In what scenarios jQuery can be used?