title: Traversing/Manipulating new window from parent window with jquery
body: <p>I found a question already with a possible solution, but I had already tried the method suggested before reading it, and it even says it's inconsistent. So I guess I'm wondering why this doesn't work:</p>
  
  <pre><code>$("img").click(function() {
      var imgwindow = window.open('imgwin.html','','width=460,height=345');
      alert(imgwindow.find("img").attr("src"));
  });
  </code></pre>
  
  <p>The goal is to set the new window's <code>img</code> to the same <code>src</code> as the image that the user clicked to open the new window. But in the above scenario, I'm just trying to tap into the new window to get what it's already-set src. I have <code>imgwin.html</code> already written with a default <code>src</code> for the image, so it should alert that url. Instead I just get <code>undefined</code>.</p>
  
  <p>I also tried the following (which should be identical on the back end), but with the same results:</p>
  
  <pre><code>$("img").click(function() {
      var imgwindow = window.open('imgwin.html','','width=460,height=345');
      alert($("img",imgwindow).attr("src"));
  });
  </code></pre>
  
  <p>I even tried variations of wrapping the <code>imgwindow</code> variable in <code>$()</code> in case somehow jquery wasn't picking up on the variable as a DOM element.</p>
  
  <p>The only thing I can guess is that since <code>window.open()</code> is a method, jquery doesn't treat it like a DOM element, even though all documentation from basic javascript tutorials treat the variable as both a method to open the window and the pointer to the window's inner DOM.</p>
  
  <h2>Note:</h2>
  
  <p>I usually prefer and recommend to other developers the use of the jquery-ui dialog widget, but in this scenario, the images are actually webcam feeds that the user will want to pop out of the main window and have open even if the main window is closed, so while I appreciate the move from popup windows in general, please avoid suggesting alternatives that involve same-window widgets. Thanks.</p>