S
samug
Can I do something just before or after the unload event is fired?
I want to submit a form just before the user leaves the page.
I have somtehing like this:
....
<script language="JavaScript"><!--
function leavingPage() {
window.document.leavingForm.submit();
//return true;
}
--></script>
....
<BODY onUnload="leavingPage()">
<form action="<%= request.getRequestURI() %>" method="post" name="leavingForm">
<input type="hidden" name="leaving" value="true">
</form>
The thing I want to do is if the user goes away from a page I reset
some variables in JSP. I just want to know if user goes away from the
page.
Thanks,
Shmuel.
I want to submit a form just before the user leaves the page.
I have somtehing like this:
....
<script language="JavaScript"><!--
function leavingPage() {
window.document.leavingForm.submit();
//return true;
}
--></script>
....
<BODY onUnload="leavingPage()">
<form action="<%= request.getRequestURI() %>" method="post" name="leavingForm">
<input type="hidden" name="leaving" value="true">
</form>
The thing I want to do is if the user goes away from a page I reset
some variables in JSP. I just want to know if user goes away from the
page.
Thanks,
Shmuel.