|
Q1048 How can I close the child window when I close its opener?
irt.org | Knowledge Base | JavaScript | Window | Q1048 [ previous next ]
Q1048 How can I close the child window when I close its opener?
Use the window handle:
<script language="JavaScript"><!--
var windowHandle = -1;
function myOpen() {
windowHandle = window.open('page.htm','windowName','width=640,height=480');
}
function myClose() {
if (windowHandle != -1)
windowHandle.close();
setTimeout('self.close()',1000); // 1 second delay before closing self
}
//--></script>
|
|
|
Copyright © 1996-2008 irt.org, All Rights Reserved.