Open a new window and close it
<html>
<body>
<script language="JavaScript">
var newWin
function function1() {
newWin = window.open("http://www.java2s.com",
"subwindow",
"width=400,height=150, left=200, resizable, top=250")
}
function hi() {
if (!newWin.closed) {
alert("The subwindow is closed");
}
}
</script>
<p style="text-decoration:underline;
cursor:hand;"
onClick="function1();">
Click to open new window
</p>
</body>
</html>
Related examples in the same category