jQuery/JSONP 小部件和 jQuery 版本冲突

发布于 2024-08-24 16:57:18 字数 257 浏览 3 评论 0原文

我想创建一个小部件,以便我的访问者可以在他们的博客/网站上显示它。

我想使用 jquery 和 jsonp 来开发这个小部件。

我知道如何避免 jQuery 和其他库(如原型)之间的冲突。

但是,如果我的访问者的网站上已经安装了 jquery 并且他们的版本与我的版本不同,会发生什么情况?

我的意思是:例如,如果他们使用较旧的 jquery 版本运行脚本并且与我的 jquery 库不兼容怎么办?它停止工作了吗?他们有什么解决办法吗?

I would like to create a widget so that my visitors can display it on their blog/website.

I would like to use jquery and jsonp to develop this widget.

I know how to avoid conflicts between jQuery and other libraries (like prototype).

But what will happen if jquery is already installed on my visitors' websites and if their version is different from my version ?

What I mean is: what if, for example, they run a script using an older jquery version and which is not compatible with my jquery library ? Does it stop working ? Is their any workaround ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

迟到的我 2024-08-31 16:57:19

调用 jQuery.noConflict() 将从 $ 并恢复之前的内容。

Calling jQuery.noConflict() will remove jQuery from $ and restore whatever was there before.

别忘他 2024-08-31 16:57:19

为什么不尝试这个小部件呢?
http://consumer.easyxdm.net/current/example/widgets.html
这比 JSONP 更强大,更安全,并且具有双向传输。

这实际上只是 easyXDM 框架的展示之一 (http://easyxdm.net/)

Why not try this for the widget?
http://consumer.easyxdm.net/current/example/widgets.html
This is far more powerful than JSONP, much safer, and it has bi-directional transport.

This is really just one of the showcases for the easyXDM framework (http://easyxdm.net/)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文