stevenk140
Programmer
Is there some event that lets me know when the page has been closed. My problem is I want to delete all files that were created during a viewing of a web page. What is the best way of doing this?
Steve
Steve
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
somepage.asp:
<html>
<head>
<script language="javascript">
function doCleanUp()
{
window.open("cleanup.asp", "", "top=2000");
}
</script>
</head>
<body onunload="javascript:doCleanUp();">
........
</body>
</html>
Notice top=2000, the new window will not be visible, just a short flash will occur.
cleanup.asp:
<html>
<body onload="javascript:closeMe()">
<%
'execute server side script to perform clean up...
%>
<script language="javascript">
function closeMe(){
self.close();
}
</script>
</body>
</html>