Unable to read the noConflict property from undefined (Chrome extension)

I have a chrome extension that uses jQuery as the contents of a script with noconflict like;

var myDomainJquery = $.noConflict(true);

on the other hand, some websites also use jQuery noconflict in their path; for example new york times

<script>var jQ = jQuery.noConflict(true);</script> 

Then I get I can not read the noConflict property of the undefined error on the host website.

Is there any way to fix this problem?

+4
source share
1 answer

Yes there is. The way to fix it is to understand an isolated context .

script - JS, ; jQuery, . , $.

+4

Source: https://habr.com/ru/post/1543445/


All Articles