[Javascript] Grab close window call

David Hucklesby davidh126 at writeme.com
Mon Mar 31 22:45:23 CDT 2008


On Mon, 31 Mar 2008 23:26:10 +0100, Alan Easton wrote:
> Hi All,
>
> I have a problem, which I am not sure is solvable.
>
> I have a pop up window on my site, that launches a chat window. Now, I would like to
> set a flag in my database, when someone ends the chat. Easy done, if someone clicks the
> "End Session" link in the window, but what if someone simply closes the window by the
> normal means of clicking "close" icon in the top right of the window.
>
> Ideally, I would like to grab that call, and set an Ajax call to update my database.
>
> Is this possible?
>

I believe the "window.onunload" event is the one you are looking for.

Cordially,
David
--




More information about the Javascript mailing list