jQuery - The noConflict() Method
What if, while using JQuery, you want to utilise other frames of your pages ?
jQuery and Other JavaScript Frameworks
As you may be aware, jQuery employs the $
symbol as a shortcut for jQuery.
There are several more well-known JavaScript frameworks, including as : Angular, Backbone, Ember, Knockout, and more.
What if the $symbol is also a shortcut in other JavaScript frameworks ?
If the same shortcut is used by two separate frames, one may stop working.
The jQuery team has previously considered this and added the noConflict()
function to their library.
Related Links
The jQuery noConflict() Method
The noConflict()
function frees the $
shortcut identifier from its hold, allowing other scripts to utilise it.
Example :-
You may still use jQuery by using its full name rather than the shortcut :
Example 2 :-
It is also extremely easy to design your own shortcut. The noConflict()
function produces a jQuery reference, which may be saved for subsequent usage in a variable. An example is this :
Related Links