Debt Consolidation - Self Improvement Articles Directory - Web Hosting - Article directory - Debt Consolidation

PDA

View Full Version : Alternative to appendChild() function


gangireddyit
Aug 25th 2008, 2:41 am
Hi ,

I am using javascript appendChild() function which is very slow, i need an alternative for this which will improve my system performance. the following is the code snippet

if(t.tBodies[count].id != null && t.tBodies[count].id == "dataRows"){
for (j=0;j<t.tBodies[count].rows.length;j++) {
t.tBodies[count].appendChild(sortRows[j]);
document.all("mainTable")[1].tBodies[count].rows[j].cells[0].innerHTML = sortRows[j].cells[0].innerHTML;
}
}

in the above i need an alternative to t.tBodies[count].appendChild(sortRows[j]); which is taking more time , please help in this

Wrighty
Aug 25th 2008, 9:17 am
What is the code doing? It might be simpler to rewrite it! :-/

gangireddyit
Aug 25th 2008, 11:16 pm
we are using the above code in table sorting, sorting is happening perfectly, after sorting we are appending the sorted rows to the same table using appendChild() method which is taking more time, our performance is poor, to improve the performance we have to optimize code i.e appendChild() method i.e we need an alternative for this.

joebert
Aug 29th 2008, 8:58 pm
I honestly think it has more to do with the "innerHTML" usage than "appendChild".