Click to See Complete Forum and Search --> : pause function


tripwater
08-21-2003, 12:17 PM
I have a popup window that asks for a site rating. Once submitted, it shows the viewer a thank you message. Instead of asking the viewer to close the window I would like to just show the message for say 4 or 5 seconds and call close();

is there a stall(); or pause (); I can use to accomplish this by passing in the seconds?

Thanks

pyro
08-21-2003, 12:21 PM
Yes, setTimeout() (http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/window.html#1203758) should be exactly what you need....

tripwater
08-21-2003, 12:59 PM
Thank you for the reply.

I apologize for this retarded question...

I am a serious newbie at JS so here is what I did.

I went to the devedgemaual from the link on that function to see what params to pass and it looked like this:

setTimeout('displayAlert()',5000)


so I thought I could do this: But it closes my window immediately. Again sorry about the ignorance here.


<SCRIPT LANGUAGE=\"JavaScript\">

setTimeout( close(),5000);


</script>

pyro
08-21-2003, 01:05 PM
You were close...

<script type="text/javascript">
setTimeout("window.close()", 5000);
</script>

tripwater
08-21-2003, 01:06 PM
thank you

pyro
08-21-2003, 01:12 PM
You're welcome... :)