本文介绍了将jQuery从1.4迁移到3.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到jQuery具有jQuery-migrate脚本来安全地升级jQuery.他们有两个jQuery迁移存储库:

  1. https://github.com/jquery/jquery-migrate (用于迁移到3 .x)
  2. https://github.com/jquery/jquery-migrate/tree/1.x-stable (用于迁移到1.9)

是否有必要先迁移到1.9,然后再迁移到3.x,还是可以仅将第一个脚本包含在我的网站中,然后直接迁移到3.x?当使用1.9中删除的API时,3.x迁移脚本不会通知吗?

解决方案

这是您提供的链接之一: https://github.com/jquery/jquery-migrate .您可以在问题中提供的链接中找到此段:

由于要从jQuery 1.4迁移到3.0,并且要根据官方文档的说明,如果计划使用jQuery Migrate 1.x解决兼容性问题,则首先需要版本1.12.x或2.2.x./p>

I saw that jQuery has the jQuery-migrate script to safely upgrade jQuery. They have two jQuery-migrate repos:

  1. https://github.com/jquery/jquery-migrate (for migrating to 3.x)
  2. https://github.com/jquery/jquery-migrate/tree/1.x-stable (for migrating to 1.9)

Is it necessary to first migrate to 1.9 and then 3.x, or can I just include the first script in my website, and migrate to 3.x directly? Does the 3.x migration script not notify when APIs removed in 1.9 are used?

解决方案

This is one of the links you provided: https://github.com/jquery/jquery-migrate. You can find this paragraph in the link you provided in your question:

Since you want to migrate from jQuery 1.4 to 3.0, and based on what the official documentation says, you first need version 1.12.x or 2.2.x if you plan to use jQuery Migrate 1.x for resolving compatibility issues.

这篇关于将jQuery从1.4迁移到3.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 01:52