Hi, this is my first post, I have a chat script wehere the user have to click a icon to leave, but some times (most of the times) they close the browser and the operator ignore it.
The idea is...when the user close the browser a function onBeforeUnload trig the link to make the class "closedthread" id"closedthread" bacome false without click.
I tried it with: <body class="closedthread" id"closedthread" onBeforeUnload="return false;">, but it works ONLY in IE9.
Most browsers now limit what onbeforeunload can be used for because a lot of sites misuse it. Also some people disable that event in their browser because of the annoying way it is misused.
The only guaranteed way to determine if the web page is still open or not is to use a heartbeat script to track from the server whether the page is still open or not.
Thank you for the answer, but the chat have that already and check for window open every 1 minute, what I was thinking is about something like this:
window.onbeforeunload = confirmExit;
\\ Here -> body return false;
return message to display in dialog box;
With the confirmation alert make the body or the link return false.
This topic is now closed. New replies are no longer allowed.