onClick="window.opener=null;window.close();"

解决方案 »

  1.   

    楼上 tacchan(tacchan)的方法不错啊!你可以试一下!我一直也用这种方法,但这种方法只能关闭当前窗口噢!如果你想关闭父窗口,要用FOCUS方法得到父窗口,然后再关闭才可;
    <html><head><title>test</title>
    <script language="jscript">
    function closewin()
    {
    document.open("test.htm","","fullscreen");
    window.opener.focus();
    window.opener=null;
    window.close();
    }
    </script>
    </head>
    <body>
    <input type=button onclick="closewin()" value="关闭上一级窗口">
    </body>
    </html>