简体   繁体   English

如何防止jQuery重叠在我的网站上(例如通过浏览器插件)

[英]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. 我在我的网站和Honeybadger上使用jQuery,以获取有关javascript异常的通知。 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/.. .) 该工具向我显示了许多错误,因为全局jQuery$变量被另一个jQuery版本覆盖(例如,来自https://ajax.googleapis.com /..。

So I am thinking about using jQuery.noConflict to use another variable for jQuery (eg $j ). 所以我在考虑使用jQuery.noConflict为jQuery使用另一个变量(例如$j )。 Since I use a few addons for jQuery, this must happen right after all of them are loaded, right? 由于我为jQuery使用了一些插件,这必须在所有这些插件加载后发生,对吧?

But does it work all the time or might another jQuery be injected before all my addons are loaded? 但它是否一直有效,或者可能在我的所有插件加载之前注入另一个jQuery?

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何构建Firefox插件以始终显示当前选项卡的书签存储的详细信息(例如标签) - How to build a Firefox addon to always show bookmark-stored-details (e.g. tags) for current tab 如何检查浏览器是否缓存了特定资源(例如图像)? - How to check if a particular resource (e.g. image) is cached by the browser? 为什么禁用浏览器网页安全(例如Chrome)有助于进行跨网站请求? - Why will disabling Browser Web Security (e.g. Chrome) help doing Cross-Site-Requests? jQuery双对象构造函数-例如$($(this)) - jQuery double object constructor - e.g. $($(this)) 什么是不使用例如jQuery时必需的浏览器特定代码的好例子? - What's a good example for browser-specific code necessary when not using e.g. jQuery? 如何在关闭页面时可靠地运行代码(例如,站点聊天中的“断开连接”消息) - How to reliably run code on page close (e.g. “disconnected” message on site chat) 如何重用WordPress网站的一部分,例如页眉,页脚,多个WordPress网站的页眉的一部分? - How to reuse parts of WordPress site e.g. header, footer, part of header for multiple WordPress sites? 如何防止屏幕阅读器焦点(不是指键盘焦点)离开预定义区域(例如,模态) - How to prevent screen reader focus (not referring to keyboard focus) from leaving predefined area (e.g., modal) 如何检查2位小数? 例如2.2.10 - how to check 2 decimals? E.g. 2.2.10 如何防止点击释放在背景上触发(例如在弹出覆盖中选择输入文本) - How to prevent a click release from firing on background (e.g. selecting input text in popup overlay)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM