Getting event when user clicks X in browser, something different from {before}bodyunload

Giganews Newsgroups
Subject: Getting event when user clicks X in browser, something different from {before}bodyunload
Posted by:  hemant.sin…@gmail.com
Date: 3 Sep 2006

Hi all,
I am trying to get a way by which I'll know exactly when user goes out
of my site by clicking on close button in browser, So that w/e user
click close button in browser, I can send a signal to server.
This seems to be achievable with body unload events, but it is little
too much, as even if user navigate within my site, this event will be
generated, this can be avoided by handling onclick of each link, so
that I'll know exactly which link is clicked, but honestly this looks
over doing to me, any other  smart short cut for finding out when user
click on X in browser?

TIA
Hemant

Replies