[jQuery] Re: Caching nodes

2009-07-08 Thread Darko Romanov
Cool! I got code execution 50% faster! Thanks. d On 8 Lug, 09:27, Darko Romanov wrote: > Ok thanks. I'm going to try it. Didn't know about the $... variables > convention. > > d > > On 7 Lug, 19:35, "Michael Geary" wrote: > > > > > What you wrote would work, and it would be faster than the ori

[jQuery] Re: Caching nodes

2009-07-08 Thread Darko Romanov
Ok thanks. I'm going to try it. Didn't know about the $... variables convention. d On 7 Lug, 19:35, "Michael Geary" wrote: > What you wrote would work, and it would be faster than the original code, > but you're making an unnecessary $() call each time you use $(list). > Instead, do it like thi

[jQuery] Re: Caching nodes

2009-07-07 Thread Michael Geary
What you wrote would work, and it would be faster than the original code, but you're making an unnecessary $() call each time you use $(list). Instead, do it like this: var $list = $("ul.list"); $list.find("li.selected").addClass("blah"); The $ in $list doesn't have any special meaning; it's ju