Upgrade from jQuery 1.x to jQuery 2.x

后端 未结 3 1335
清歌不尽
清歌不尽 2021-01-30 20:09

I am trying to upgrade from jQuery 1.x to jQuery 2.x.

I have jQuery 1.8 and jQueryUI 1.8, and now I want to upgrade to jQuery 2.x and enhance my web app.

So m

3条回答
  •  我在风中等你
    2021-01-30 21:13

    In jQuery 1.9, several methods were removed that were available in prior versions of jquery.

    If you are using those methods, then yes, you will run into problems.

    Otherwise, no you will not run into problems.

    Using the jQuery migrate plugin that you mentioned will solve all of the problems that you could possibly have with upgrading from 1.8 to 1.9+(which includes 2.x) and it will also inform you of any methods you are using that have been removed when you look at the console. The migrate plugin is the best way of upgrading jquery from 1.6x-1.8x to 1.9+/2.0+. Include jquery 2.x, then include the migrate plugin, then open your console and replace old methods until the migrate plugin stops giving your warnings. At that point you should be able to safely remove the migrate plugin.

提交回复
热议问题