I build my site on jQuery version 1.4.2 (not realizing about any updates) but now it doesn't seem to work in IE8. When searching for a solution i thought about an update. When i use jQuery 1.7.1. however, some strange things occur. For example this example on jsFiddle
http://jsfiddle.net/64d2T/
When running this example in 1.4.4 it works fine, but when i run the code in 1.7.1 the format is messed up.
Does anybody know this problem and i'm a doing some basic stuff wrong?
It depends from project to projects, what should you do when upgrading jQuery:
$("input).attr("checked")which priour to 1.6 returned true, now you should use
$("input:checked")
Also it's a good idea to go through all release notes and understand the purpose of any change, and make some notes on what should you check in your project http://docs.jquery.com/Downloading_jQuery#Past_Releases
the .add() method seems to be working differently ... providing a context fixes the problem :
http://jsfiddle.net/64d2T/5/
Replacing :
$(this).find('.news-title-description').add('.news-meta').add('.news-item-link').add('.news-header').addClass('active-news-item');
with :
$(this).find('.news-title-description').add('.news-meta',$(this)).add('.news-item-link',$(this)).add('.news-header',$(this)).addClass('active-news-item');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With