Click to See Complete Forum and Search --> : Opening a window using setTimeout


dmason165
03-07-2003, 04:23 PM
Hello all:

I have my "Welcome" page set to timeout (close) after 2 seconds. I need to alter it so that when it closes, it opens my homepage in another window using window.open() (so I can set parameters).

Also, I have the word "Welcome" on the same page which is set-up to determine if viewers of my site have JS enabled, and if so, the onClick behavior is called to open my homepage. However, I would like to ALSO have onClick to close the page.

My code for this latter request looks like this thus far:

<a href="DirectionsForEnablingJavaScript.htm" onClick="javascript:PostWelcome(); window.close; return false">Welcome</a>

However, this does not work. Do I/can I put something in the function: PostWelcome that will solve this?

Thank you in advance for your time and your help.

~Darron

Jona
03-07-2003, 04:26 PM
Yah, what you're doing should work, but try instead <body onUnload="PostWelcome();">

dmason165
03-07-2003, 04:32 PM
This works beautifully!! I knew it was something simple I was overlooking! This way has actually given me a better way to do what I want! Thanks again for the help and your rapid response!

Jona
03-07-2003, 04:33 PM
No problem. :cool: