var win=window.open()
if(win && !win.closed)
{
  setTimeout("win.close()",500)
}

解决方案 »

  1.   

    <body>
    <script>
    function exe()
    {
    window["open"].close();
    }
    </script>
    <input type=button onclick='window["open"] = window.open("http://www.sina.com.cn");window.setTimeout(exe,5000)'>
    </body>
      

  2.   

    <script>function b(){
    window.open("http://www.sina.com","a")
    setTimeout("a.close()",1000)}
    window.onload=b
    </script>
    -----------------------------
    请问为什么这样不可以啊?
    关注
      

  3.   

    pop=self.open("http://www.sina.com.cn","弹出窗口","toolvar=no,location=yes,directories=no,status=no,menubar=no,top=0,left=0,scrollbars=no,resizeble=0,width=330,height=220");
    self.setTimeout("pop.close()",3000);//三秒后关闭