[jQuery] Re: $('.someclass[initialized!=1]') fails in 1.3; works in 1.2 (if elements don't have initialized attr)
Yep, i noticed this yesterday. Thanks! On Jan 22, 7:49 pm, John Resig wrote: > This was fixed in 1.3.1. > > --John > > > > On Thu, Jan 22, 2009 at 4:42 PM,Soulcatcher wrote: > > > Say i have several elements with class='someclass' and they DON'T have > > attribute 'initialized' initially. > > > When i do $('.someclass[initialized!=1]') in 1.2.6, i get the list of > > all those elements. > > In 1.3, i get an empty list. I traced it to line 1986 in jquery 1.3 > > (Revision 6104) that will return false if given attribute doesn't > > exist. > > > So, is it a bug or a 'feature' of 1.3? :) I hope it's a bug cause this > > is very useful when you want to get all elements that weren't > > initialized before. > > > If it's a feature, what's the best way of doing this check then? using > > each() like this: > > $('.someclass').each(function(){ > > if($(this).attr('initialized') != 1){initialize..;$(this).attr > > ('initialized',1) } > > }); > > > ? Was so easy and simple before...
[jQuery] Re: $('.someclass[initialized!=1]') fails in 1.3; works in 1.2 (if elements don't have initialized attr)
This was fixed in 1.3.1. --John On Thu, Jan 22, 2009 at 4:42 PM, Soulcatcher wrote: > > Say i have several elements with class='someclass' and they DON'T have > attribute 'initialized' initially. > > When i do $('.someclass[initialized!=1]') in 1.2.6, i get the list of > all those elements. > In 1.3, i get an empty list. I traced it to line 1986 in jquery 1.3 > (Revision 6104) that will return false if given attribute doesn't > exist. > > So, is it a bug or a 'feature' of 1.3? :) I hope it's a bug cause this > is very useful when you want to get all elements that weren't > initialized before. > > If it's a feature, what's the best way of doing this check then? using > each() like this: > $('.someclass').each(function(){ > if($(this).attr('initialized') != 1){initialize..;$(this).attr > ('initialized',1) } > }); > > ? Was so easy and simple before... >