如何检查我用open打开的窗口是否还存在?

同上
---------------------------------------------------------------

1<script language="javascript">   
2var xxx=window.open("a.htm"); //这里可以是你已经打开的网页的句柄   
3function closewindow()   
4{   
5if (xxx && xxx.open && !xxx.closed)   
6xxx.close();   
7}   
8</script>

---------------------------------------------------------------

 1<script>   
 2a=null   
 3function test()   
 4{   
 5if(a && a.open && !a.closed)   
 6a.focus()   
 7else   
 8a=window.open()   
 9}   
10</script>
1<input onclick="test()" type="button" value="test"/>
Published At
Categories with Web编程
Tagged with
comments powered by Disqus