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>



If you find this article useful, consider making a small donation
to show your support for this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2012
[ home ]