title: How to know when popup is closed in javascript
body: <p>This code will open go.com in popup window:</p>
  
  <pre><code>&lt;a href="javascript:void(0)" onClick="javascript:window.open('http://go.com','','status=yes,scrollbars=yes,toolbar=no,menubar=no,location=no ,width=300px,height=300px')"&gt;open&lt;/a&gt;
  </code></pre>
  
  <p>and I want to use <code>alert('closed!')</code> in main page,  when popup is closed and I can't edit popup page for use <code>onunload="alert('closed!')"</code>, because the popup page is an external page and I can't change the code like </p>
  
  <pre><code>var mywindow = window.open('http://go.com') ...
  </code></pre>
  
  <p>Thanks.</p>