L
lrlebron
I am using the following to detect if a popup window is already open.
I only want to open a new window if it does not exist or has been
closed.
<HTML>
<HEAD>
<script language="JavaScript" type="text/javascript">
<!--
var myPage;
function openMyPage() {
if (!myPage || myPage.closed){
myPage=window.open("default.aspx", "_blank");
}
else {
alert("NFSL1 is already opened");
}
}
//-->
</script>
</HEAD>
<BODY>
<FORM>
<INPUT TYPE="button" onClick="openMyPage();" VALUE="open MyPage">
</FORM>
</BODY>
</HTML>
The code works correctly in Firefox, but IE6 opens a new window every
time.
Any ideas?
thanks,
Luis
I only want to open a new window if it does not exist or has been
closed.
<HTML>
<HEAD>
<script language="JavaScript" type="text/javascript">
<!--
var myPage;
function openMyPage() {
if (!myPage || myPage.closed){
myPage=window.open("default.aspx", "_blank");
}
else {
alert("NFSL1 is already opened");
}
}
//-->
</script>
</HEAD>
<BODY>
<FORM>
<INPUT TYPE="button" onClick="openMyPage();" VALUE="open MyPage">
</FORM>
</BODY>
</HTML>
The code works correctly in Firefox, but IE6 opens a new window every
time.
Any ideas?
thanks,
Luis