Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    want to call javascript on browser close

    hi,
    the browser i use is mozilla firefox.
    i want to call a function when someone closes firefox.
    but without using body unload event. because that is called even if i move to any other page.

    can someone pls tell me how i can do it?
    please reply.

    thank you.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,928
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    If you mean call a function when the user closes his browser, that is impossible.

    Pressing "alt+f4" or clicking on the "X" button, just closes the window without being prompted or alerted to anything. And what about people who have Javascript disabled?

    See also:-

    http://social.msdn.microsoft.com/For...-5949f1978ea5/


    Quizmaster: Which "C" is a former German prisoner of war camp which is now used as a scout hostel?
    Contestant: Auschwitz.


  •  

    Posting Permissions

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