PDA

View Full Version : dynamic html with javascript not being dynamic


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
}

cedd82
09-10-2006, 06:56 PM
bump

it would be fine even if i could just prompt the user that processing was taking place, like change the icon of the mouse for example to the hour glass. However everything just hangs untill all the processing is done and then everything is done all at once.

the only thing i can do without hanging is alerts, but alerts arnt a very good way to prompt the user that processing is going on.

_Aerospace_Eng_
09-10-2006, 08:24 PM
The likely reason for you not receiving a response is you haven't posted the rest of your code. I see some things in there that are defined else where but you haven't supplied those parts of the script.