title: How to get element and html from window.open js function with jquery
body: <p>I am trying to open a popup like this:</p>
  
  <pre><code>$('#btn').click(function () {
      var popup = window.open('mypage.php', '_blank', 'width=500,height=500');
      var dom = popup.document.body;
      for (i in dom) {
          console.log(dom[i]);
      }
  });
  </code></pre>
  
  <p>Now what I want to do is to get the html from the popup window and also be able to use maybe a jQuery function from the window.opener (the page that opened the popup)</p>
  
  <p>PS. In the console there are a lot of things printed but no html source.</p>
  
  <p>Use this to try: <a href="http://jsfiddle.net/JRqTy/" rel="noreferrer">http://jsfiddle.net/JRqTy/</a></p>
  
  <p>Thanks in advance.</p>