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
Explain the difference between jquery-x.x.x.js and jquery.x.x.x min.js?
Tell me does jquery 2.0 supports ie? : jquery mobile
Which selector has better performance id or class and why?
What is the goal of cdn and what are the advantages of using cdn?
What is the jQuery code to select all links inside the paragraph?
How do I pull a native DOM element from a jQuery object?
How to use jquery?
How to read, write and delete cookies in jquery?
Explain jquery.noconflict? : jquery mobile
Differentiate between calling stop (true, true) and finish method?
Why should I use jquery?
How can we add change font size using jquery?
What is jQuery connect?
How to executed jquery selectors? : jquery mobile
How to get the server response from an ajax request using jquery?