How to update jQuery from 1.4.4 to 1.7.1?

In our project, we are now using jQuery 1.4.4 and jQuery UI 1.8.7. But we want to update these files to versions 1.7.1 and 1.8.18, respectively. Please give me the correct transition algorithm.

+4
source share
3 answers

Retrieve the latest files from the jQuery and jQuery UI site and update the <script> and <link rel="stylesheet"> tags to match the updated file names.

While you probably don't need to make many major changes to your own code, it's nice to get an overview of new features and improvements between versions. I suggest you familiarize yourself with the blog announcements that are published in each issue, as they summarize the most important changes.

You should be especially aware of the changes made to the way attr / prop behaves in version 1.6.1 . Some occurrences of attr should probably be changed to prop . In addition, you should consider changing any use of live , which is now deprecated (but still working), to the new on method introduced in version 1.7.

It will also be useful to get the latest versions of other jQuery plugins.

+5
source

I am afraid that there is no "algorithm". Go and get them from the site here or update the script tags with the CDN links also listed on this page.

If you need help with the upgrade path that you come across, check out the release notes between the versions. Now I'm just reading minds.

+2
source

All you have to do is download the new versions of jQuery and jQuery UI scripts and change the <script> tags to include the new versions. Your code should still work. However, you will need to update some obsolete functions, for example, replace .live() and .bind() with .on() . You can also use jQuery Lint to find other legacy code. There is no algorithm as such.

+1
source

Source: https://habr.com/ru/post/1402253/


All Articles