title: Send response when window is closed
body: <h2>The goal</h2>
  
  <p>Send <code>true</code> or <code>false</code> when window is closed.</p>
  
  <h2>The problem</h2>
  
  <p>When I click on a button, a window is opened with <code>window.open();</code> syntax. What I  need seems to be simple: when the window is closed, return to the window that opened the popup a response from the server, that can be <code>true</code> or <code>false</code> — like the Facebook's API does.</p>
  
  <p><strong>Someone knows how can I do this in a simple way?</strong></p>
  
  <h2>Spotlight</h2>
  
  <p>I don't want to use jQuery because the page's CSS is overwriting the popup's CSS.</p>
  
  <h2>Current syntax</h2>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>[...]
  &lt;a href="#" class="share" data-networkName="&lt;?php echo $network-&gt;name; ?&gt;"&gt;
      Share&lt;/a&gt;
  [...]
  </code></pre>
  
  <p><strong>JS:</strong></p>
  
  <pre><code>$(".share").on("click", function(event) {
      event.preventDefault();
  
      var networkName = $(this).data("networkName");
  
      window.open("share.php?network=" + networkName");
  });
  </code></pre>