Forums

This topic is locked

Auto Close Window

Posted 23 years ago
1
has voted
23 years ago 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 23 years ago
23 years ago 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 23 years ago
23 years ago Stephen Bateman replied:
Thanks spk100,

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

Stpehen

Reply to this topic