Life after onUnload event

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top