<script type="text/javascript">
document.write("'myWindow' has been closed!")
document.write("'myWindow' has not been closed!")
<script type="text/javascript">
myWindow=window.open('','','width=200,height=100')
myWindow.document.write("This is 'myWindow'")
<input type="button" value="Has 'myWindow' been closed?" onclick="checkWin()" />