Rodolfo
Rodolfo

Reputation: 4183

What do I want to do when upgrading jQuery from 1.4.x to 1.6.x

Currently I use 1.4.4 in my sites, and considering upgrading to the latest (1.6.4). In your experience, is there any reason why I shouldn't just replace the jquery file (I host it in my server). What things should I be careful of?

Upvotes: 2

Views: 502

Answers (5)

gnarf
gnarf

Reputation: 106412

I found this blog that covers all the important points...

http://davidtong.me/upgrading-jquery-from-1-4-x-to-1-6-1

Paraphrased tips:

  • You should check every use of .attr()... There are many that should now be .prop()
  • JSON Parsing is MUCH MORE strict in 1.5+
  • New AJAX module with lots of improvements you can take advantage of.

This should apply for all 1.4.x -> 1.6.x releases.

You might also want to take a look at the 1.7 release candidate notes as that is soon approaching as well...

Upvotes: 2

Sparky
Sparky

Reputation: 98748

There are some semantical fixes in jQuery 1.6.

For example, certain things like defaultValue and checked have always been considered to be "properties", but in the past, jQuery has accessed them as if they were "attributes". jQuery 1.6 now correctly accesses "properties" with prop rather than attr.

Therefore, you may need to update lines of code that use attr() and removeAttr(), as appropriate, to prop() and removeProp().

Otherwise, check the website of each plugin to see if there are updates and apply them. Then update jQuery and see what happens. You can always put it back the way it was.

Upvotes: 1

Patricia
Patricia

Reputation: 7802

have a look through the release notes and look at the breaking changes. see if any of those will affect your code, and go from there.

personally, i'm still using 1.4.2 on one of my projects b/c there was some changes to the way ajax requests / data was handled (i don't remember exactly what) and it completely broke a lot of my model binding and such.

Upvotes: 1

Deleted
Deleted

Reputation: 4998

You should check any plugins for compatibility and upgrade those and thoroughly test everything after upgrading. Otherwise it should be fairly painless.

Upvotes: 0

Bozho
Bozho

Reputation: 597392

The thing that can break is plugins. You should:

  • check the plugin official compatibility notes
  • carefully test each feature that relies on plugins

Upvotes: 1

Related Questions