Click to See Complete Forum and Search --> : Problems with the SetTimeOut() Function.


AntonioMainenti
12-31-2002, 09:19 PM
This has be absolutely baffled.

I made a function, and it's supposed to do some stuff and then start a setTimeOut function that will make the function do its stuff again and again. Here's a very simplified version of what I'm doing:

function doStuff()
{

x++;
form.text.value=x;

var timeout=setTimeOut("doStuff()",1000);

}

But for some reason, it gives the 'Error on Page.' message and says that an object was expected on the line with the setTimeOut function.

I can't figure out what I'm doing wrong. Please help. Thanks.

khalidali63
12-31-2002, 09:43 PM
Well by the looks of it,if it is not a typing error then your setTimOut spellings are incorrect it should be like this

setTimeout

instead of Large Case O small case o

:-)

Khalid

AntonioMainenti
12-31-2002, 10:18 PM
Thanks. It works fine now.