Verify Open Window

[Total: 0    Average: 0/5]

This will open up a new window and then when you click the button verify if it is open or not.

Body Code:

<a href="javascript:createWindow()">start example</a>
<script language="JavaScript">
var win1;
var scriptTags = "<html>" +
                 "<title>Sample Window</title>" + "a" +
                 "<script>var winOpen=true;</script>" +

function createWindow() {
  win1 ="", 

function validateWindow() {
  if (win1.winOpen == null)
     alert("Window does NOT exist.");
  else {
     win1.focus(); // give window focus 
     alert("Window exists!");
<input type=button 
       value='Check Window' 

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *