Updating jQuery 1.7.1 to the latest 2.x version - What are the breaking changes?

3.7k Views Asked by At

I need to update jQuery 1.7.1 to the latest 2.x version. The target application contains too many scripts/plugins which should be carefully revisited to handle those breaking changes that happened though the years. However, I do not remember all those "breaking" changes, so I thought maybe someone could point me to the right direction. For example, this document lists the deprecated functions which helps a lot but it's not enough yet.

Please note that I'm not going to target IE6/7/8 so I insist on upgrading to the latest 2.x version. Any strategy, check list or information to ease "the pain" is highly appreciated.

2

There are 2 best solutions below

1
Dominic Zukiewicz On BEST ANSWER

Have a look at this Sitepoint post as it is a higher level explanation of the changes than just the API. These are summarised as:

  • No support for IE6/7/8
  • Deprecated features means code is removed and smaller download
  • More modular codebase to allow the inclusion or exclusion of components.

There are a huge amount of changes, but if you aren't interested in IE6/7/8, this should be fine.

0
Amit Joki On

The main thing I would advise you is on using live(). It has been replaced by on().

So, you should check for live code and convert to on code.

The other one is .selector. It was deprecated as accurate selector couldn't be given.

Also size() is deprecated. Just use .length