title: Executing parent function on child close event
body: <p>I'm facing a boring issue here. I need to call a function on the parent window inside the close event of the child window. My code is like this:</p>
  
  <pre><code>$(function(){
      $("#btnPlay").click(function(){
          ShowPopup("URL", 600, 600, DoSomeStuff);
  
      });
  });
  function DoSomeStuff(){
      // Do some stuff
  }
  function ShowPopup(url, width, height, closeCallback){
      var options = "resizable=yes, status=no, location=no, menubar=no, width= " + width + ",height=" + height;
      var w = window.open(url, "_blank", options );
      w.onunload = function(){ 
          // INVOKE DoSomeStuff of the parent window
          console.log("X");
      }
  
  }
  </code></pre>
  
  <p>But seems that the <strong>onunload</strong> event doesn't get called! What might be wrong?</p>