jQuery 1.9向后兼容性问题? [英] jQuery 1.9 backward compatibility issue?

查看:211
本文介绍了jQuery 1.9向后兼容性问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在使用jQuery 1.6.2的网站上使用jQuery插件.当我将jQuery版本更改为1.9时,该插件将不再起作用.我认为jQuery中具有向后兼容功能.有什么办法知道/修复在1.9中不起作用的代码?如果有帮助,我尝试使用一个名为CropZoom的插件,并且此处是链接.让我知道是否有类似的插件具有相同的功能.我会感激的. 谢谢

I am trying to use a jQuery plugin on my site which uses jQuery 1.6.2. When I change the jQuery version to 1.9 the plugin no longer works. I thought there was a backwards compatibility feature in jQuery. Is there any way to know/fix the code that does not work in 1.9? If it helps I am trying to use a plugin called CropZoom and here is the link. Also, let me know if there is similar plugin the same features. I'll appreciate it. Thanks

推荐答案

这是jQuery告诉您的解决方法:

我们意识到现有站点和插件可能会受到这些更改的影响,并且正在为过渡升级路径提供jQuery Migrate插件.下面的各个描述表示是否可以使用jQuery Migrate插件恢复1.9中更改的行为.请注意,jQuery 1.9中的所有更改也将适用于jQuery 2.0,并且jQuery Migrate插件也将在那里使用.

We realize that existing sites and plugins may be affected by these changes, and are providing the jQuery Migrate plugin for a transitional upgrade path. Individual descriptions below indicate if the behavior changed in 1.9 can be restored by using the jQuery Migrate plugin. Note that all of the changes in jQuery 1.9 will also apply to jQuery 2.0, and the jQuery Migrate plugin will be usable there as well.

jQuery Migrate插件的未压缩开发版本包括控制台日志输出,以在使用特定的不赞成和/或删除的功能时发出警告.这使其成为用于查找和修复现有jQuery代码和插件中的问题的迁移调试工具非常有价值.一直到1.6.4为止,它都可以用于jQuery core的诊断.

The uncompressed development version of the jQuery Migrate plugin includes console log output to warn when specific deprecated and/or removed features are being used. This makes it valuable as a migration debugging tool for finding and remediating issues in existing jQuery code and plugins. It can be used for its diagnostics with versions of jQuery core all the way back to 1.6.4.

插件的压缩版本不会生成任何日志输出,并且当需要jQuery 1.9或更高版本时可以在生产站点上使用,但还必须使用较旧的不兼容jQuery代码或插件.理想情况下,这只能用作短期解决方案,但这是您要做出的决定.

The compressed version of the plugin does not generate any log output, and can be used on production sites when jQuery 1.9 or higher is desired but older incompatible jQuery code or plugins must also be used. Ideally this would only be used as a short-term solution, but that's a decision for you to make.

此处链接

其他选项

  • 请与插件开发人员联系,以查看插件是否已升级
  • 找到功能相同或相近的插件的新版本
  • 用相关的替换代码替换折旧的代码,从而自己更新插件代码.

这篇关于jQuery 1.9向后兼容性问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆