[thelist] How to auto close an Internet explorer window / page

Nik Schramm n at industriality.com
Mon Sep 23 16:05:01 CDT 2002


On 23.Sep.02 21:45 Jim Rhodes wrote

> I am looking for an HTML or Javascript method to automatically close a web
> page x seconds after it has loaded.

In your pop-up html page place this js code inside the <head> of the
document:

<script type="text/javascript">
<!--
function shutDown() {
	self.close();
}
function init() {
	var timer = setInterval(shutDown, 5000);
}
onload = init;
//-->
</script>

This will automatically close the pop-up window after 5000ms, which
works out as 5 seconds. Adjust to suit.

Best
--
/nik




More information about the thelist mailing list