0

i am trying to code a chat app for my social network and i am using the following module ..

http://anantgarg.com/2009/05/13/gmail-facebook-style-jquery-chat/

i have coded the rosters(manage who is online) for it ..

but those rosters work only on login/logout .. on login it makes an entry for username in a database and then all the online friends are displayed on the page that appears after login and the record is deleted when the user logouts . but when a user directly closes the browser the database record is not deleted ..

is there a way to do the deletion when the browser closes without logout .. or can anyone give me a tutorial for creating the rosters (manage who is online and so on ..) ..

thanx in advance ,
Sohail .. :)

2
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by diafol
0

Logout on close browser is difficult. JS needs to hijack your browser:

<script>
window.onbeforeunload = confirmExit; 
function confirmExit()
{ 

return "Put your message here!";

}
</script>

Edited by diafol: n/a

0

Thank u very much ardav , this solved my problem !!!!!! I used alert() instead of return ..

Thanx Again ..

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.