下のボタンでサブウィンドウを開いたまま、別のページに移動してみてください。移動すると同時にサブウィンドウも閉じられます。
<SCRIPT language="JavaScript"><!--
newW = "";
function SubOpen(){ //サブウィンドウを開く
newW = window.open('','win','width=500,height=300,left=100,top=200');
newW.document.write("<H3>サブウィンドウ</H3><HR>");
newW.document.write("<P>このサブウィンドウは、呼び出し元のページが移動したり閉じられたら、同時に閉じます。</P>");
newW.document.close();
}
function SubClose(){ //サブウィンドウを閉じる
if(newW != ""){ //サブウィンドウが既に開かれている場合
if(!newW.closed)newW.close(); //閉じられていない場合は閉じる
}
}
//--></SCRIPT>
</head>
<body onunload="SubClose()">
<form name="form1">
<input type="button" name="bt" value="サブウィンドウを開く" onclick="SubOpen()">
</form>
end(01/9/4)