102、检查窗口的关闭打开

102、检查窗口的关闭打开

脚本说明:

把如下代码加入<body>区域中

<script>

var newwin

function makenewwin() {

newwin=window.open("","vv","height=300,width=200")

newwin.document.writeln("ok")

newwin.document.close()

}

function check() {

if (newwin&&newwin.open&&!newwin.closed){

alert("开的")

}

else{

alert("关的")

}

}

</script>

<input type="button" value="open" onclick="makenewwin()">

<input type="button" value="检查" onclick="check()">

 

Write a comment

Comments: 0