cedd82
09-07-2006, 06:54 PM
hi,
I was hoping someone could help me with this, im racking my brain.
a cut down version of my problem:
i basicly have a for loop that on each execution of the loop it adds a row to a html table. say each execution of the loop takes 1 second, then you would expect that a row would be added each second but instead all the rows appear after the computer hangs for ages doing all the processing.
this problem does not occur however if i for example did alerts instead of adding rows to a table.
i was thinking mabey theres soem simple line of code i can add to make it process things on the fly better.
anyone run into a similar problem ?
btw im running javascript in windows ie 6.0 and im running the script in HTA
for (x in array)
{
//processing
var x=document.getElementById('myTable').insertRow()
var y=x.insertCell(0);
var z=x.insertCell(1);
var r=x.insertCell(2);
var q=x.insertCell(3);
//output the data to the html table
//y.innerHTML= malFilenamesHyperlink[temp];
y.innerHTML = lenderImplementationHyperlinks[i];
y.style.backgroundColor=theColor;
etc etc
}
I was hoping someone could help me with this, im racking my brain.
a cut down version of my problem:
i basicly have a for loop that on each execution of the loop it adds a row to a html table. say each execution of the loop takes 1 second, then you would expect that a row would be added each second but instead all the rows appear after the computer hangs for ages doing all the processing.
this problem does not occur however if i for example did alerts instead of adding rows to a table.
i was thinking mabey theres soem simple line of code i can add to make it process things on the fly better.
anyone run into a similar problem ?
btw im running javascript in windows ie 6.0 and im running the script in HTA
for (x in array)
{
//processing
var x=document.getElementById('myTable').insertRow()
var y=x.insertCell(0);
var z=x.insertCell(1);
var r=x.insertCell(2);
var q=x.insertCell(3);
//output the data to the html table
//y.innerHTML= malFilenamesHyperlink[temp];
y.innerHTML = lenderImplementationHyperlinks[i];
y.style.backgroundColor=theColor;
etc etc
}