Hi all, so the onbeforeunload event doesn't have mouse information, so how do I get mouse XY? I am trying to know if the user clicked the close buttom on the browser to log them out right away (20minutes of session is too long for resource, but, we will not shorten it to make customer angry).
On IE, I can simply access mouse info to figure out if the user clicked close buttom or not during the onbeforeunload. For FF, I am suppose to use the parameterized event, which sadly has no mouse info at all.
(Note, this is not needed if there is a REAL onBrowserClose event. Since this is not the case, I am working on the alternatives.)
Thank you all.
Just to make sure people understand it, here is example.
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript">
function test(event) {
var X = window.event ? window.event.screenX : event.clientX;
// IE only because event.clientX for FF = fail.
if (X == null) {
alert("No X");
return;
}
};
</script>
</head>
<body onbeforeunload="test(event);">