> I've got a for loop in which I have jQuery select a different DOM 
> element for each iteration. The code I've got that selects the element is:
>
>     FlexCell = $("[EMAIL PROTECTED]" + ShiftDate + "]");
>
> So far, it's taking about three seconds to complete a loop of fifteen 
> iterations. Yikes! :o( If I remove the above line from the code, it's 
> lightning quick! 

Maybe use filter for that case? (Requires >1.0.4 because it was fixed
recently)

// ... set up invariants here (comparison array, regexp, whatever)
FlexCell = $("td").filter(function(){
        var dv = this.getAttribute("dateValue");
        // ... do comparison here and return true to include ...
});

  


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to