...

View Full Version : window.opener.closed



alaios
08-08-2002, 10:33 PM
Why this does not work?
Hi I want to check if the window that had opened the small window is still opened.
So I write this code in the small window


<script language="JavaScript">
<!---
function check() {
if (window.opener.close) {
window.open("openercheck.htm","hi");
}
}
//-->
</script>
</head>

<body bgcolor="#FFFFFF" text="#000000" >
<script language="JavaScript">
window.setInterval("check()",1000);
</script>


it works only in netscape 4.75 but is does not in ie 5!!
I am calling every second the check function . The check function checks if the main window is still opened . If it is not open is again .

jkd
08-08-2002, 11:23 PM
I believe IE has a known bug where window.closed returns the opposite it is supposed too... MSDN should have an article on it somewhere.

jkd
08-08-2002, 11:25 PM
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q241109&

More specifically.

Spookster
08-08-2002, 11:26 PM
Can you try:

if (!window.opener) {
window.open("openercheck.htm","hi");
}

adios
08-09-2002, 12:38 AM
Could be that bug; but your original code is incorrect....

<script type="text/javascript" language="javascript">

setInterval('if (opener.closed) open("openercheck.htm","hi")',1000);

</script>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum