• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

server to be notified when browser closes

 
mohan kumar nie
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when user closes the browser, I want server to be notified.
If I use <BODY onUnLoad="javascript:notifyServer()"> , this will be called everytime when user request for another page.
How to achieve above functionality in Microsoft Internet explorer.
 
prabhat kumar
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
check for window.closed property of window object
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is one of the most often asked questions in the forum... Do a search and you should be able to find more info.
The main point is that you can't be guaranteed that your server will be notified everytime a browser is closed, so don't count on it.
 
prabhat kumar
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what u really want to do by knowing the browser closing?
 
Dale DeMott
Ranch Hand
Posts: 515
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't know when the user closes the browser. This is why you have a session timeout. There is no way to tell from the server side if the user has already left or not until the session has timed out.
-Dale
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic