Migrating jQuery from 1.4 to 3.0

為{幸葍}努か 提交于 2020-01-12 07:15:26

问题


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?


回答1:


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:

NOTE: To upgrade to jQuery 3.0, you first need version 1.12.x or 2.2.x. If you're using an older version, first upgrade to one of these versions using jQuery Migrate 1.x, to resolve any compatibility issues. For more information about the changes made in jQuery 3.0, see the upgrade guide and blog post.

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.



来源:https://stackoverflow.com/questions/45789166/migrating-jquery-from-1-4-to-3-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!