Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q747 How can close a popup window after a delay?

You are here: irt.org | FAQ | JavaScript | Window | Q747 [ previous next ]

Basically place the following within the new page:

<BODY onLoad="setTimeout('window.close()',5000)">

where 5000 is 5 seconds.

If you don't have access to the new page to amend the body tag, then use the following:

<SCRIPT LANGUAGE="JavaScript"><!--
windowHandle = window.open('page.htm','windowName','width=400,height=400');

setTimeout('windowHandle.close()',5000);
//--></SCRIPT>

©2018 Martin Webb