Here are a few more jQuery functions.
Different scripts cannot work at the same time. Hence, in order to remove the conflicts, we use the noConflict()
function.
Its syntax is as follows:
$.noConflict()
An optional parameter for this method is removeAll
. This parameter is used to release the control over all jQuery variables. It's a Boolean value. If present, it indicates that the control over all values must be released.
The $
symbol is used by various JavaScript libraries, which if used alongside jQuery may cause issues. The noConflict()
function returns the control of the $
symbol to the other library.
The following code shows how one event has to wait when the other event is in process:
$.noConflict(); jQuery(document).ready(function() { jQuery("button").click(function() { jQuery("p").text("jQuery is still working!"); }); });