title: return result from popup window
body: <p>I have button which will open an popup window, popup window redirect to several page and return to one final page, </p>
  
  <p>Now i would like to get status of last page in parent open window</p>
  
  <p>what i tried <a href="https://stackoverflow.com/questions/9276086/popup-window-to-return-data-to-parent-on-close">this</a></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
          &lt;title&gt;&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;?php
          // put your code here
          ?&gt;
          &lt;button id="imageinstagram"&gt;Images&lt;/button&gt;
          &lt;script src="jquery-1.7.2.min.js" type="text/javascript"&gt;&lt;/script&gt;
          &lt;script&gt;
              $(document).ready(function(){
                  $('#imageinstagram').click(function(){
                      window.open("./login.php",'','menubar=no,status=no,width=200,height=200') ;
                  });
  
              });
              function HandlePopupResult(result) {
                  alert("result of popup is: " + result);
              }
          &lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Now login.php redirect to success.php</p>
  
  <p>success.php has following code</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
          &lt;title&gt;&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;        
              &lt;script&gt;
              function CloseMySelf(sender) {
                  try {
                      window.opener.HandlePopupResult(sender.getAttribute("result"));
                  }
                  catch (err) {}
                  window.close();
                  return false;
              }
  
              CloseMySelf();
          &lt;/script&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Still My parent window is not getting any alert</p>