微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

jQuery迁移插件处理弃用代码的效果如何?

我很快将负责升级到jQuery 1.9.那说我知道我们住的几个地方();切换();徘徊();和browser();途中有很多惊喜,– 我很有信心.

如果我添加迁移插件,它是否会继续执行旧代码 – 或者只是在控制台中给我消息以帮助我追踪并修复问题?

有没有人从1.4.1跳到1.8或1.9?已经实现了迁移插件并看到它的工作原理和局限性?

解决方法

官方jQuery网站很好地描述了 http://jquery.com/upgrade-guide/1.9/#jquery-migrate-plugin

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.

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.

原文地址:https://www.jb51.cc/jquery/176714.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐