<script>
win=window.open("about:blank");function CloseWin()
{
  if(!win.closed) win.close();else alert('已经关闭了');
}
</script>
<a href='#' onclick='CloseWin()'>关闭</a>

解决方案 »

  1.   

    <html>
    <script type="text/javascript">
    var winHadle;
    function openWindow()
    {
    winHadle=window.open("b.htm");
    }
    function closeWindow()
    {
    winHadle.close();
    } </script>
    <body>
    <input type="button" onclick="openWindow()" value="open">
    <input type="button" onclick="closeWindow()" value="close">
    </body>
    </html>
      

  2.   

     
     function fullwindow(){
          window.open(document.frame1.document.location, 'bigs', 'fullscreen=yes');
       //  document.frame1.document.ondblclick=document.frame1.window.close();  这句不行
      }
       <input type="button" onclick="fullwindow()" value="fullscreen"> 因小弟打开的是一个全屏窗口,所以再回去操作原来的那个窗口就不是很方便了,小弟想通过  双击 或者 esc 关闭打开的全屏窗口(在fullwindow中实现),不知各位大哥有没有办法。
      

  3.   

    <html>
    <script type="text/javascript">

    function openWindow()
    {
    var a=window.open(window.location);
    }
    </script>
    <body ondblclick="if(opener){window.close()}">
    <input type="button" onclick="openWindow()" value="Open Window">
    </body>
    </html>
      

  4.   

    <script>
    function fullwindow()

       var win=   window.open("about:blank", 'bigs', 'fullscreen=yes'); 
       win.document.ondblclick=function(){win.close();}
    win.document.onkeydown=function(e){e=e||win.event;if(e.keyCode==27)win.close();}
      } 
    </script>    <input type="button" onclick="fullwindow()" value="fullscreen">  
      

  5.   

    <html>
        <script type="text/javascript">
            var winHadle;
            function openWindow()
            {
                winHadle=window.open("b.htm");    
            }
            function closeWindow()
            {
               if(winHadle)
                winHadle.close();
            }    </script>
        <body>
            <input type="button" onclick="openWindow()" value="open">
            <input type="button" ondblclick="closeWindow()" value="close">
        </body>
    </html>
      

  6.   

    YH_Random 大哥,你的正是我需要的。