<html> |
<head> |
<script type= "text/javascript" > |
function checkWin() |
{ |
if (myWindow.closed) |
{ |
alert( "新窗口已经关闭!" ) |
} |
else |
{ |
alert( "新窗口没有关闭!" ) |
} |
} |
</script> |
</head> |
<body> |
<script type= "text/javascript" > |
myWindow=window.open( '' , '' , 'width=200,height=100' ) |
myWindow.document.write( "这是一个新窗口" ) |
</script> |
<input type= "button" value= "检验新窗口的状态" onClick= "checkWin()" /> |
</body> |
</html> |