473,327 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

SetTimeout not working correctly in IE

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.
Jul 23 '05 #1
4 5540
You have the syntax correct, Its probally another Microsoft bug.

Jul 23 '05 #2
tshad wrote:
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.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #3
mo******@yahoo.com wrote:
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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #4
"Randy Webb" <Hi************@aol.com> wrote in message
news:4b********************@comcast.com...
tshad wrote:
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?

In my case, it just stays there for IE, but not for mozilla.

Tom.

Define "doesn't work". It works just fine, in 15 seconds, in IE6 XP SP2
for me.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq

Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
2
by: Athanasius | last post by:
Could someone shed some light as to why the following setTimeout function will not work on the Mac IE5.2? It does however work on PC(Forefox,Netscape,IE) & Mac(Safari,Firefox). Here is the script,...
5
by: John Bokma | last post by:
Hi, I am working on a simple chat program and want to use AJAX. In order to get the new lines added to the chat I need to call a server-side script, say every x seconds. A second way to get...
12
by: Andrew Poulos | last post by:
With the following code I can't understand why this.num keeps incrementing each time I create a new instance of Foo. For each instance I'm expecting this.num to alert as 1 but keeps incrementing. ...
28
by: Andre | last post by:
Hi, Does anyone know whether the ECMA, or an other standard document, specifies a maximum for the value that can be pass to the setTimeOut() function in Javascript? Andre
1
by: James Black | last post by:
I am trying to fade a word out, so after 5 seconds then every 1/4 sec it should fade by a small amount, until it is gone. This works fine in Firefox, but IE never calls the function that...
4
by: E | last post by:
I am having trouble with setTimeout working on a second call to the setTimeout function from a second page which is an html page. Here is the scenario. I have a web page and onload it calls a...
7
by: Martin | last post by:
Can I have two setTimeouts running at the same time - with two different intervals? I want to start one timer and, before it times out, start another one I've tried this and they seems to...
4
by: si4 | last post by:
Hello, I'm currently studying javascript by myself. I thought that I will write js that will remove element in the body from DOM every 2 seconds, untill all elements in the body are deleted(...
1
by: alex.malgaroli | last post by:
Hi all. I didn't find anything on the web regarding this different behaviour I found in Firefox (v. 2) and IE (v. 6), so I'm posting it here, maybe someone will benefit from this. I have a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.