Results 1 to 2 of 2

Thread: How to trap window close event of Browser in IE

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2006
    Posts
    3

    How to trap window close event of Browser in IE

    I want to trap the event of the Window close of the Browser using Java Script so that I can call the function on that event.
    I am writing a Client Server application using Java Script and Java Servlets. I am giving client a database connection when the user correctly logins to the server, that connection is returned to the connection pool
    when the user logs out using the Logout link.
    The problem is when the user closes the browser window (using X) without logging out. I don't know how to trap the window close event of the browser so that I can write the function to return that users connection back to the pool. I have tried using onunload event but it is also fired when the next page is called. I don't know how to go about for the solution.

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: How to trap window close event of Browser in IE

    Not possible, sorry. You can only time out sessions and return the connection then.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

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