试试看,是可以的!
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head><body onUnload="newwin.window.close()">
<script language="JavaScript">
var newwin=window.open("about:blank","_blank","resizable=yes,scrollbars=yes");
</script>
<input type="button" onClick="window.close()" value="关我">
</body>
</html>

解决方案 »

  1.   

    我改进了一下,这应该是你要得吧
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    </head><body  >
    <script language="JavaScript">
    var newwin=null;
    function openWin(){
        newwin=window.open("about:blank","_blank","resizable=yes,scrollbars=yes");
    }
    function closeWin()
    {  if(newwin!=null)
        { if(typeof newwin.window=="object")
             newwin.window.close();
         else
             alert("新窗口已经关闭了!");
        }
      else
        alert("新窗口还没有打开!");
    }
    </script>
    <input type="button" name="b" onClick="openWin();" value="开我">
    <input type="button" name="c" onClick="closeWin();window.close();" value="关我">
    </body>
    </html>