SetTimeout not working correctly in IE

Discussion in 'Javascript' started by tshad, Dec 1, 2004.

  1. tshad

    tshad Guest

    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.
     
    tshad, Dec 1, 2004
    #1
    1. Advertising

  2. tshad

    Guest

    You have the syntax correct, Its probally another Microsoft bug.
     
    , Dec 3, 2004
    #2
    1. Advertising

  3. tshad

    Randy Webb Guest

    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
     
    Randy Webb, Dec 3, 2004
    #3
  4. tshad

    Randy Webb Guest

    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
     
    Randy Webb, Dec 3, 2004
    #4
  5. tshad

    tshad Guest

    "Randy Webb" <> wrote in message
    news:...
    > 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
     
    tshad, Dec 3, 2004
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?SUdvdFlvdXJEb3ROZXQ=?=

    sort not working correctly

    =?Utf-8?B?SUdvdFlvdXJEb3ROZXQ=?=, Aug 18, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    507
    =?Utf-8?B?SUdvdFlvdXJEb3ROZXQ=?=
    Aug 18, 2004
  2. Athanasius

    setTimeout not working on Mac IE 5.2

    Athanasius, May 3, 2005, in forum: Javascript
    Replies:
    2
    Views:
    424
    Richard Cornford
    May 7, 2005
  3. James Black

    setTimeout not working on IE

    James Black, Apr 14, 2006, in forum: Javascript
    Replies:
    2
    Views:
    654
    Randy Webb
    Apr 14, 2006
  4. SetTimeout not working

    , Aug 14, 2006, in forum: Javascript
    Replies:
    3
    Views:
    155
    Dr John Stockton
    Aug 14, 2006
  5. Shan

    SetTimeout not working with IE

    Shan, Feb 22, 2008, in forum: Javascript
    Replies:
    4
    Views:
    122
    Thomas 'PointedEars' Lahn
    Feb 24, 2008
Loading...

Share This Page