title: window.closed IE9 reporting true when window is still open
body: <p><strong>UPDATE 2012-01-10</strong><br/>
  the popup URL is in another domain as the parent window, which appears to be the issue! How can I solve it?</p>
  
  <p>I'm using the following code to detect whether the popup window is closed. It works fine in Firefox 8 and Chrome but doesn't function as expected in IE9. In IE9 the alert with "true" shows already when the popup is still open. How come IE9 has a reference to the window and the <code>closed</code> property reports <code>true</code> when the window is still open? And how can I fix it?</p>
  
  <p><strong>Javascript</strong></p>
  
  <pre><code>var dialogWindow;
  var dialogTimer;
  function openDialog(url, name, options) {
   dialogWindow = window.open(url, name, options);   
   dialogTimer = setInterval(function() {   
    if(dialogWindow.closed) // IE9 reports true and executes function
    {  
     alert(dialogWindow.closed); // alert with "true"
     clearInterval(dialogTimer);  
     window.location.reload();  
    }  
   }, 2500);
  
   if (dialogWindow &amp;&amp; dialogWindow.focus) 
    dialogWindow.focus();     
  }
  </code></pre>
  
  <p><strong>UPDATE</strong>
  I also tried the following approach, which shows the exact same behaviour in IE9</p>
  
  <pre><code>var dialogWindow;
  var dialogTimer;
  function openDialog(url, name, options)
  {
      dialogWindow = window.open(url, name, options);   
      dialogTimer = setInterval("checkDialogOpen()", 2500);
  
      if (dialogWindow &amp;&amp; dialogWindow.focus) 
          dialogWindow.focus();     
  }
  
  function checkDialogOpen()
  {
      if(dialogWindow.closed) 
      {  
          alert(dialogWindow.closed);
          clearInterval(dialogTimer);  
          window.location.reload();  
      } 
  }
  </code></pre>