nationavon
MIS
I have a window that spawns a child window that contains a java applet. When the user closes the child I need to be sure that the parent was closed first. I've tried the following:
<SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript">
<!-- Hide
window.onbeforeunload = unloadFunc;
function unloadFunc()
{
if(self.opener.closed) {
mess = ""
return mess;
} else {
alert('You must close the other window first!');
window.onbeforeunload = null;
}
}
// unhide -->
</SCRIPT>
The only problem is that it gives the alert but the window closes anyway. I need a way of aborting the onbeforeunload event until the parent window has been closed.
<SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript">
<!-- Hide
window.onbeforeunload = unloadFunc;
function unloadFunc()
{
if(self.opener.closed) {
mess = ""
return mess;
} else {
alert('You must close the other window first!');
window.onbeforeunload = null;
}
}
// unhide -->
</SCRIPT>
The only problem is that it gives the alert but the window closes anyway. I need a way of aborting the onbeforeunload event until the parent window has been closed.