PDA

View Full Version : Delaying an onload event


BusterLee
10-31-2002, 12:58 AM
I presently have the following body tag:

<BODY vLink=#124a82 aLink=#0000ff link=#124a82 bgColor=#f5f5f5 leftMargin=0
topMargin=0 rightMargin=0 MARGINHEIGHT="0" MARGINWIDTH="0" onload="popup();">

Simply the onload is for a popup (obviously!!)

However I want to delay this a little. I know that popups are the dreaded subject but I would appreciate any help.

It would be nice to allow it about 5 seconds or more after page has completely loaded. By the way the java in the popup uses cookis so as only to popup once per browser session. I hope this will not make any difference.

Cheers in advance

chrismiceli
10-31-2002, 01:47 AM
put this in the popup function


test = window.open("blah.html","test","whatever");
setTimeout("test", 5000);

Beck
10-31-2002, 04:09 AM
how about:
<body onload="window.setTimeout('popup()',5000);">

This way all the work is still happening in the body tag, where you're expecting it to (other than the work to actually run the popup function, of course).