Hello.
I am trying to set a timeout for a portion of my code that is inside of a for() loop, and the function receives a variable thats known to the function within which the for() loop takes place, a global (to that function) var array:
setTimeout("updateTag(getDirList(),'jpg',0,'../display/'+arr[cell]);",10000);
however i get an error, saying the array 'arr' is undefined. Not sure if setTimeout can receive variables.. if so, what am i doing wrong? if i bring the function call outside the setTimeout, it works, so my function call cant have a mistake. thanks.
I am trying to set a timeout for a portion of my code that is inside of a for() loop, and the function receives a variable thats known to the function within which the for() loop takes place, a global (to that function) var array:
setTimeout("updateTag(getDirList(),'jpg',0,'../display/'+arr[cell]);",10000);
however i get an error, saying the array 'arr' is undefined. Not sure if setTimeout can receive variables.. if so, what am i doing wrong? if i bring the function call outside the setTimeout, it works, so my function call cant have a mistake. thanks.