Detect if a window is already openedTag(s): Language


<HTML><HEAD><SCRIPT>
var myPage;
function openMyPage() {
   if (!myPage || myPage.closed){
      myPage = 
          window.open("myPage.html", "_blank");
      }
   else {
      alert("MyPage.html is already opened");
      }
 }
</SCRIPT></HEAD>
<BODY>
<FORM>
<INPUT TYPE="button" 
       onClick="openMyPage();" 
       VALUE="open MyPage">
</FORM></BODY></HTML>

blog comments powered by Disqus