title: Unable to access contents of IFRAME in jQuery
body: <p>I'm having difficulty encountering the <code>contents()</code> of an IFRAME via jQuery.  It is actually a frame within a frame that I'm trying to access.  The frames are all from the same source (same domain, same root path, etc.).</p>
  
  <p>I'm currently accessing the frame via:</p>
  
  <pre><code>var $frame = $(window.top.frames[1].document).find('#innerFrameName');
  </code></pre>
  
  <p>This works fine, and if I <code>console.log</code> the value of $frame, I see that it's a jQuery array:</p>
  
  <pre><code>[&lt;frame src=​"mypage.htm" id=​"innerFrameName" frameborder=​"1" border=​"1" scrolling=​"auto" title=​"My Inner Frame" name=​"bsscright"&gt;​]
  </code></pre>
  
  <p>However, the moment I try to call the following (as explained in this <a href="https://stackoverflow.com/a/1639342/107277">StackOverflow question</a>), I get an empty array.</p>
  
  <pre><code>var $contents = $frame.contents();
  console.log($contents);       // =&gt; []
  </code></pre>
  
  <p>Even if I try to get to the document itself, I can't.</p>
  
  <pre><code>var innerDocument = $frame.get(0).document;
  console.log(innerDocument);   // =&gt; undefined
  </code></pre>
  
  <p>I even tried going about it without jQuery, and I'm getting the same results as above.</p>
  
  <pre><code>var innerFrame = window.top.frames[1].frames['innerFrameName'];
  var innerDocument = innerFrame.document;
  console.log(innerFrame);     // =&gt; the DOM object representing the IFRAME
  console.log(innerDocument);  // =&gt; undefined
  </code></pre>
  
  <p>What am I doing wrong?</p>