jQuery/JSONP 小部件和 jQuery 版本冲突
我想创建一个小部件,以便我的访问者可以在他们的博客/网站上显示它。
我想使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
阅读此内容:
Read This:
调用
jQuery.noConflict()
将从$
并恢复之前的内容。Calling
jQuery.noConflict()
will remove jQuery from$
and restore whatever was there before.为什么不尝试这个小部件呢?
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/)