|So here's the situation: I have a web based program that allows a user to log in, take a test, etc. To prevent a user from accidentally exiting out of a test before they are done, I am using the onbeforeunload event that brings up the popup to allow a user to confirm to navigate away from the page. i.e.|
window.top.onbeforeunload = unloadMess;
mess = "This will finish your test attempt.";
The problem is that when they do close the test in this manner, it needs to be recorded in the event log. So I have come up with 2 possible solutions, but I don't know how to implement them (or if they are even feasible). One, create my own popup similar to the one provided by the browser and find out the user response that way, or two, somehow regain control before the page closes and log the event. Any help would be great!