I have a function that is called on document.ready that loops through a table with roughly 600 rows that was generated in classic ASP. In a "modern" browser (Chrome, Firefox, IE9 Beta) it runs in under 1.5-2 seconds. In IE6 it runs in around 5-7 seconds, not good.
Basically what I'm doing is adding the value of the cells in certain columns and giving subtotals. (I know, this should be generated on the server-side, but some brainiac developed this using views that calls views, who call views, who call views...).
I used IE9's profiler to try to get a sense of where a bottle neck is and it seems to be most profound when jQuery's find and each is called:
tr.find("td").each(function() {
&
tr.find("td").eq(ci).html(tot).css
I will post all of the code if necessary but I was wondering is there a more efficient way of looping through unnamed table rows and cells?
The table looks like:
32 47 0/0 0 8 1 1
32 47 -7 0/0 0 0 7
Totals -7 0/0 8 1 8
32 47 0/0 0 2 1 1
32 47 -7 0/0 0 3 7
Totals -7 0/0 5 1 8
I loop through the table rows and if I find a (td:first) = "Totals" then I place the current tr, and the two previous tr's in variables, then grab cells and calculate totals, and place those totals in the appropriate cells.
This all works but like I said there is a serious bottle neck during find and each.