dcsimg
www.webdeveloper.com
Results 1 to 4 of 4

Thread: onunload in <Body> Not working

  1. #1
    Join Date
    Mar 2003
    Location
    Pa.
    Posts
    96

    Question onunload in <Body> Not working

    Please look at the simple html below:
    The function defined in the onunload will not do the alert on my IE Exp. Browser, but will work on another PC's IE Exp. Browser.

    How can this be.

    any help would be appreciated.
    Thanks
    Clyde

    <html>
    <head>
    <Script language="javascript">
    function testun()
    {
    alert("Test UN Found");
    }
    </Script>
    </head>
    <body onunload="testun()">
    <form>
    Test Unload
    </FORM>
    </body>
    </html>

  2. #2
    Join Date
    Mar 2004
    Location
    The 'Peg
    Posts
    74
    I'm running IE 6 on XP and using that code, it doesn't work when I close the window, but if you create a link on the page, and click the link, you will get the pop-up.

    I'm not sure if that helps, but if you're looking for a pop-up when the user closes the window, I'm sorry, but I can't help there... but I'm sure someone else will!!

  3. #3
    Join Date
    Mar 2003
    Location
    Pa.
    Posts
    96

    To Stopper31

    Thanks for your reply.

    At first I thought I was crazy, so I tried the simplest HTML I could find and tried it on my PC and The PC in the next office,
    The Alert inf the onunlod function does not work on my PC but works on the PC in the other office.

    I do not know of any settings in IE Exp. that could prevent this.

    If you Think of any thing get back to me

    Clyde

  4. #4
    Join Date
    Jul 2003
    Location
    Boston Area, Massachusetts
    Posts
    3,489
    This was cross-posted in the JavaScript section, just so anyone viewing this thread knows. As for the original poster, please refrain from cross-posting in the future.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles