Ticket #11665 (closed bug: duplicate)
|Reported by:||prince_ppy||Owned by:|
I was following jquery from 1.5, in my websites. recently I havejust updated with 1.7.2 in my development thinking that I can use latest features to make site work better, the site started breaking.
After analysing I found that the "attr" function is the problem center. if I switch back to 1.7.1 jquery the code $(this).attr("for") => will give me "divMain" and if I switch to 1.7.2 the same code is giving as [object].
I have downloaded the development version of both 1.7.1 & 1.7.2 and found that the problem is in jquery 1.7.2.js line number 2227 "return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );". I found out that for a code "$(this).attr('for')" the arguments.length = 3, again I looks at arguments.length regardless of whether the last argument was undefined, so if you make a function that passes all of it's arguments to .attr, it would fail.
May be when some other js code override attr function, it may be always send arguments more the one, then code's behind: return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); will go not correctly, it deal as chainable. the other auguments will be undefined. it has no problem in jquery version 1.6.2. i don't know if it should let other changing their code or change the jquery core.
So what am saying is that "with out any change in code of file in my project, if I Switch the the new verion of jquery (1.7.2). the site breaks. So their are some very minner problems.