You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have initialized window.jQuery = jQuery; now, i want to add some prototype functions with different jQueries, like var a = window.jQuery; var b = window.jQuery; a.fn.helloWorld = () => 1; b.fn.helloWorld = () => 2;
In this case, when i use noConflict from a variable, then b has undefined then, how can i use jquery for this case?
The text was updated successfully, but these errors were encountered:
dmuralimohan
changed the title
Need to resolve conflict from Multiple jQuery from single page
Need to resolve conflict to Multiple jQuery's from single page
Oct 9, 2023
You can assign each instance of jQuery to a distinct variable by loading it more than once, as an alternative to utilizing noConflict. This is an illustration:
I have initialized window.jQuery = jQuery; now, i want to add some prototype functions with different jQueries, like
var a = window.jQuery;
var b = window.jQuery;
a.fn.helloWorld = () => 1;
b.fn.helloWorld = () => 2;
console.log(a.fn.helloWorld()); // 2
console.log(a.fn.helloWorld()); // 2
In this case, when i use
noConflict
froma
variable, thenb
has undefined then, how can i use jquery for this case?The text was updated successfully, but these errors were encountered: