Top.Mail.Ru
? ?
Javascript's Journal
 
[Most Recent Entries] [Calendar View] [Friends View]

Wednesday, August 20th, 2008

Time Event
2:31p
Help on setTimout()
I'm trying to call a method from the body onload to submit my form after 60 seconds has passed. But it's ignoring the time I set and just submitting the page right when it loads.

my functions:

SCRIPT LANGUAGE="JavaScript"><!--
function doOnload() {
setTimeout(formsubmit(),60000);
}
//-->
</SCRIPT>SCRIPT LANGUAGE="JavaScript"><!--
function formsubmit() {
alert('its time!');
top.main.location.href =
"/rrr/rrrServlet?action=autosave"
}
//-->
</SCRIPT>


and in the body tag:
onLoad="doOnload();"

Anyone know why it's ignoring the time?

Thanks

<< Previous Day 2008/08/20
[Calendar]
Next Day >>
About LiveJournal.com
Image