Results 1 to 3 of 3

Thread: JS: Close event

  1. #1

    Thread Starter
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416

    JS: Close event

    I have this script that suppose to be the alert pop up when you close the page but when I refresh the page 'F5' the alert pop up. What's wrong w/ this? Is there another way to do this? Just pop up an alert when you try to close the page?
    Code:
    <html>
    <head>
    <title>sample</title></head>
    <body onbeforeunload="alert('closing');">
    </body>
    </html>

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: JS: Close event

    When you refresh, you're closing the page; that is expected behaviour.

  3. #3
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: JS: Close event

    Humm, was it possible in JavaScript to see where the user is browsing to? (I'm on GPRS right now so googling is a pain.)

Posting Permissions

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



Click Here to Expand Forum to Full Width