How do I check to see if a child window is open, before opening another?

var myWin;
function openWin(aURL) {
  if (!myWin || myWin.closed ) {
    myWin = window.open(aURL,'myWin');
  } else {
    myWin.location.href = aURL;
    myWin.focus();
  }
}

Popup windows cause usability problems and are generally best avoided.



Other FAQ Resources: