954,580 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Coding Chat Application For My Website .. Need Help !!

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 .. :)

rajdevsohail
Newbie Poster
13 posts since Apr 2011
Reputation Points: 10
Solved Threads: 3
 

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

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

return "Put your message here!";

}
</script>
diafol
Rhod Gilbert Fan (ardav)
Moderator
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
 

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

Thanx Again ..

rajdevsohail
Newbie Poster
13 posts since Apr 2011
Reputation Points: 10
Solved Threads: 3
 

Okk mark thread solved :)

diafol
Rhod Gilbert Fan (ardav)
Moderator
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: