Puoi fare cosi.
File principale.
codice:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<script language="JavaScript" type="text/javascript">
<!--
var aMyPopup = null;
function popUp() {
wnd_parms2 = "height=500, width=700, menubar=no, toolbar=no,resizable=no,scrollbars=yes";
aMyPopup = window.open("test3001b.html","pop_up",wnd_parms2);
}
function isPopUpOpened() {
if (aMyPopup == null) {
return false;
}
if (aMyPopup.closed) {
return false;
}
return true;
}
//-->
</script>
</head>
<body>
<input type="button" value="Opens popup" onclick="popUp()">
<input type="button" value="Test popup" onclick="alert(isPopUpOpened())">
</body>
</html>
File test3001b.html
codice:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
Pop UP
</body>
</html>