database change after pressing 'X' button
- by Anup Prakash
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.