title: Bind event on another window
body: <p>I'm working on an image browser/upload feature,  and I'm using <a href="http://www.phpimageeditor.se/" rel="nofollow noreferrer">PHP Image Editor</a> to help me allow users to edit their images once they've been uploaded.   Images are not stored on the web server, but on a separate file server.  So what I do is:  when an image is selected for editing from the image browser page, I download the image from the fileserver to a temp file on the web server,  send that temp file to the PHP Image Editor in a new popup window so they can edit it <strong>and then I'm stuck</strong>.</p>
  <p>When the &quot;<a href="http://www.phpimageeditor.se/phpimageeditor/index.php?imagesrc=sample.jpg" rel="nofollow noreferrer">Save and Close</a>&quot; button is clicked in the new child popup window, it saves all changes on the image back to the temp file, which I then need to upload back to the file server. I'm looking for a way to bind the &quot;<a href="http://www.phpimageeditor.se/phpimageeditor/index.php?imagesrc=sample.jpg" rel="nofollow noreferrer">Save and Close</a>&quot; button in my new PHP Image Editor popup window from the parent window JS,  This will let me know when to upload the temp file back to the file server.</p>
  <p>Is it possible to bind to events on a new popup window from its parent?</p>
  <p>i.e.:
  JS in Parent window</p>
  <pre><code>$('a.edit').click(function(event) {
      var $newWindow = window.open(myHREF); // &lt;-- Child Window
      $newWindow.focus();
      return false;
  });
  </code></pre>
  <p>When the Child Window finishes loading, it will hold the contents from my phpimageeditor/index.php file  and in the DOM is the &quot;Save and Close&quot; button (<code>#btnsave</code>).</p>
  <p>Can I target that node (<code>#btnsave</code>) from the JS file in my parent window, since it created the new popup?</p>