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
Jquery can be used in what scenarios?
Can you please explain the difference between body onload() and document.ready() function? : jquery mobile
How you get server response from an ajax request using jquery?
How we can set the html contents of an element in jquery?
What is the difference between onload() and document.ready()?
Differentiate between calling stop (true, true) and finish method?
Tell me how to use migrate jquery plugin if possible? : jquery mobile
What are the types of selectors in jQuery?
Can we call C# code behind using jQuery?
Explain the difference between onload() and document.ready() function used in jquery?
What is the use of jQuery.ajax method ()?
How to debug jQuery?
Can we call c# codebehind method using jquery?
What is $() in jquery library?
How to programmatically trigger a click event that's being handled by jquery?