Hello everyone,
I have a chatroom. If someone leaves, I need to tell the server that
person has left. Currently i catch window.onbeforeunload to check if
the person tries to leave. I noticed that when I don't have a dialog
popup asking if the person really wants to leave, my Ajax-request code
doesn't always get sent to the server. Basically, the popup ensures my
beforeunload code gets executed. Why is this?
Also, when I try to stop the event, it will popup a dialog box that I
didn't make with the text "Are you sure you want to navigate away from
the page?". Is this a firefox/IE thing? Is there anyway to change the
text on the dialog box?
Thanks!
Jason Ho