怎样写让主窗口关闭子窗口也跟着关闭

test.htm
-------------------------------------------
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
<script>
var win;
function openOper()
{
  win=window.open('test1.htm', '_blank','location=no,menubar=yes,scrollbars=yes,resizable=yes,toolbar=yes,top=0,left=0');
}
function closeOpen()
{
  win.close();
}
</script>
</head>

<body onunload="closeOpen();">

<p><input type="button" value="打开" name="B3" onclick="openOper();"></p>

</body>

</html>

posted @ 2006-11-25 10:47  '.Elvis.'  阅读(267)  评论(0编辑  收藏  举报