如何判断窗口已打开或已关闭?

用ASP编写一短消息功能, 对有新消息时会自动弹出窗口, 如果已有该窗口则不弹出!
---------------------------------------------------------------

 1<script>   
 2var newwin   
 3function makenewwin() {   
 4newwin=window.open("","vv","height=300,width=200")   
 5newwin.document.writeln("ok")   
 6newwin.document.close()   
 7}   
 8function check() {   
 9if (newwin&&newwin.open&&!newwin.closed){   
10alert("开的")   
11}   
12else{   
13alert("关的")   
14}   
15}   
16</script>
1<input onclick="makenewwin()" type="button" value="open"/>
1<input onclick="check()" type="button" value="检查"/>

看看
from www.jzzy.com

Published At
Categories with Web编程
Tagged with
comments powered by Disqus