我刚写完。贴出来大家一起努力。<script type="text/javascript">
<!--
var win1 function winOpen()
{
    win1 = window.open('a.htm','','width=300px,height=200px');
}function theIf(){ if (win1.closed)
{
alert("winclosed");
}
else
{
alert("winopen");
}
-->
</script>
  调用 theIf() 函数,就可以判断 a.htm 窗口现在的状态。

解决方案 »

  1.   


    上面的 function theIf()少了一个 } 在最后,你自己填上就行了。复制时出错了。
      

  2.   

    我将 theIf() 又修改了一下。 现在包含在窗口未打开时的判断。function the(){  if (win1){ if (win1.closed){
    alert("winclosed");
    }
    else{
    alert("winopen");
    }  }}
      

  3.   

    demo.htm<script>
    win=window.open('myweb.htm','winname');
    </script>
    <input type="button" value="Check"
    onclick="if(win.closed)alert('win关闭了')">