I am trying to do the following:
1. parent window opens child window.
2. there is a link in the child window, that should open in the parent window
This all works fine, using the following code in the parent window:
<!--
function checkWindow(window) {
msgWindow=open('',window,'resizable=yes,width=200,height=100');
if (msgWindow.opener == null) msgWindow.opener = self;
};
//-->
</script>
<a href="check.cgi" alt="Check" target="check" onClick="checkWindow('check');" >Monitor</a>and the following code in the child window
function load(file,target) {
target.window.location.href = file;
}
//--></script>
<a href="#" onClick="load('script.cgi',top.opener)">Details</a>
The problem I having is that when the user has closed the parent window, nothing happens when they click on the 'Details' link in the child window. I would like to check if the parent window is still open, and if not, open a new window, and then display the page in that new window.
How would I do that?
Ivan
-----
Iyengar Yoga Resources / GT Plugins
1. parent window opens child window.
2. there is a link in the child window, that should open in the parent window
This all works fine, using the following code in the parent window:
Code:
<script language=JavaScript> <!--
function checkWindow(window) {
msgWindow=open('',window,'resizable=yes,width=200,height=100');
if (msgWindow.opener == null) msgWindow.opener = self;
};
//-->
</script>
<a href="check.cgi" alt="Check" target="check" onClick="checkWindow('check');" >Monitor</a>
Code:
<script language="JavaScript"><!-- function load(file,target) {
target.window.location.href = file;
}
//--></script>
<a href="#" onClick="load('script.cgi',top.opener)">Details</a>
The problem I having is that when the user has closed the parent window, nothing happens when they click on the 'Details' link in the child window. I would like to check if the parent window is still open, and if not, open a new window, and then display the page in that new window.
How would I do that?
Ivan
-----
Iyengar Yoga Resources / GT Plugins