简体   繁体   中英

How to prevent jQuery overlading on my site (e.g. by a browser addon)

I am using jQuery on my website and Honeybadger to get notified about javascript exceptions. The tool shows me many errors that occurr because the global jQuery and $ variables are overwritten by another jQuery-Version (eg from https://ajax.googleapis.com/.. .)

So I am thinking about using jQuery.noConflict to use another variable for jQuery (eg $j ). Since I use a few addons for jQuery, this must happen right after all of them are loaded, right?

But does it work all the time or might another jQuery be injected before all my addons are loaded?

只要所有插件都知道使用$ j,加载其他jquery时无关紧要。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM