Forums

This topic is locked

Auto Close Window

Posted 21 Feb 2002 15:06:32
1
has voted
21 Feb 2002 15:06:32 Stephen Bateman posted:
Can anyone help me with a script to close a window. I have simple popup window that adds a record to a database then displays a confirmation message. What I want is to close the window after say 30 seconds.

Thanks in advance.

Stephen

Replies

Replied 26 Feb 2002 07:02:54
26 Feb 2002 07:02:54 Praveen Kumar replied:
add this to the head
<script language="JavaScript">
<!--
function closeWin(thetime) {
setTimeout("window.close()", thetime);
}
//-->
</script>
and then add this to the body tag.
onLoad="closeWin('6')"

it will look like this

<body bgcolor="#FFFFFF" text="#000000" onLoad="closeWin('6')">

6 is the time in milliseconds.



spk100

www.reachme.at/spk100
Replied 01 Mar 2002 01:27:16
01 Mar 2002 01:27:16 Stephen Bateman replied:
Thanks spk100,

That worked a treat, first time and easy even for me.

Stpehen

Reply to this topic