Hi all,
Is there anyway i can detect the browser close event? I cannt use “onunload” event of the body because it will fire when ever i refresh the browser.
I will explain my senario so u`ll undestand this better.
Im writting a online books system where editors can login to my system and write books. There is a frontend so anyone come into my site can view all the books available.
The problem is in the backend.Some books can be writtn by two authors. So when ever a author editing his book i access denied for anyone who tyring to access that same book.So when ever the author saves the data only others can access that perticular book.
So lets assume that author has selected a book and accidently close the browser or he did it purposly. eventhough the editor leave the editing section now my system have no way of identify that. So i was thinking of catching the browser closing event and called an AJAX function to release that book from that author.
But To do this i need to catch exactly the browser closing event that fire only when a user close the browser using “X” button.
All the comments and suggestions are welcome.
Thanx in advance,
Regards,
niroshan