xpatrolx
12-16-2005, 05:17 AM
Hello,
I have read 50 or so posts and keep rewriting (piecing code together) to accomplish one of two things.
Either 1: Pop open a small window onunload which checks to see if it is on the same domain as the parent window and if so, closes itself.
or
2: Pop open the small window onunload. When the parent reloads it closes the popup (onload=close the child window).
I can get the popups to open just fine, but don't know how to close them when the parent reloads.
This loads the popup onclick or onunload:
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_closeBrWindow(theURL,winName,features) { //v2.0
window.close(theURL,winName,features);
}
//-->
</script>
I've tried amongst 20 other things:
<body onload="window.close('popup.html')"> in the parent window.
and in the popup
<script type="text/javascript">
function {
if parent.window.location = "http://www.whatever.com/parent.html";
"self.close()";
}
</script>
Thanks for any ideas.
I have read 50 or so posts and keep rewriting (piecing code together) to accomplish one of two things.
Either 1: Pop open a small window onunload which checks to see if it is on the same domain as the parent window and if so, closes itself.
or
2: Pop open the small window onunload. When the parent reloads it closes the popup (onload=close the child window).
I can get the popups to open just fine, but don't know how to close them when the parent reloads.
This loads the popup onclick or onunload:
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_closeBrWindow(theURL,winName,features) { //v2.0
window.close(theURL,winName,features);
}
//-->
</script>
I've tried amongst 20 other things:
<body onload="window.close('popup.html')"> in the parent window.
and in the popup
<script type="text/javascript">
function {
if parent.window.location = "http://www.whatever.com/parent.html";
"self.close()";
}
</script>
Thanks for any ideas.