database change after pressing 'X' button
Posted
by Anup Prakash
on Stack Overflow
See other posts from Stack Overflow
or by Anup Prakash
Published on 2010-06-03T07:33:25Z
Indexed on
2010/06/03
7:34 UTC
Read the original article
Hit count: 250
What i know:- We can use Ajax to change database from javascript. So whenever we press the 'X' button on title bar it calls "onbeforeunload" event. And by this event we can change the database.
But in my case, i want to change the status of user only when user click on 'X' button. Not in case of changing the page. As because changing the page is unloading the page. and closing the page is also unloading the page(As much i know).
Is there any way to differentiate between closing the page and moving from one page to other page?
I want to use it for changing the status of user(i.e. login/logout), whenever he presses cross button.
I don't want to set status "logout" when user changes the page. I want to set status "logout" when user 'X' the button.
Plese help me.
© Stack Overflow or respective owner