window.close();

解决方案 »

  1.   

    你写错了是window.close();而费windows.close();
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档 </title>
    <script language='javascript'>
    function test()
    {
    window.close();
    }
    </script>
    </head><body>
    <label>
    <input type="submit" name="Submit" value="提交" onclick="test();" />
    </label>
    </body>
    </html> 
      

  2.   

     WINDOWS未定义那就找到代码里面的WINDOWS,因为你WINDOWS确实没有定义,所以你把它定义一下!呵呵!如下,有点白痴,但是这解决问题的正确思路!
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档 </title>
    <script language='javascript'>
    function test()
    {
    var windows= window;
    windows.close();
    }
    </script>
    </head><body>
    <label>
    <input type="submit" name="Submit" value="提交" onclick="test();" />
    </label>
    </body>
    </html>