SetTimeout not working correctly in IE

T

tshad

I have a script to close my window after a specified amount of time (in this
case about 15 seconds).

**********************************************
<script language="javascript">
function KillMe()
{
setTimeout("self.close()",15000);
}
</script>
</head>

<body style="margin:0" onLoad="KillMe();">
****************************************************

This script works fine in Mozilla, but in IE it stays open for about 2
seconds and closes.

Why doesn't it work for IE?

Thanks,

Tom.
 
R

Randy Webb

tshad said:
I have a script to close my window after a specified amount of time (in this
case about 15 seconds).

**********************************************
<script language="javascript">
function KillMe()
{
setTimeout("self.close()",15000);
}
</script>
</head>

<body style="margin:0" onLoad="KillMe();">
****************************************************

This script works fine in Mozilla, but in IE it stays open for about 2
seconds and closes.

Why doesn't it work for IE?

Define "doesn't work". It works just fine, in 15 seconds, in IE6 XP SP2
for me.
 
R

Randy Webb

You have the syntax correct, Its probally another Microsoft bug.

Had you tested it, you would have found the answer. But its easier to
say "Oh, its an MS bug" than it is to test it and find out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top