Get frame contents with jQuery
<p><strong>main.html</strong> has this code:</p>

<pre><code>&lt;iframe id="myframe" src="myframe.html"&gt;&lt;/iframe&gt;
</code></pre>

<p>and I trigger this code inside main.html:</p>

<pre><code>alert($('#myframe').contents().find('#mypage').contents().find('html').html());
</code></pre>

<p><strong>myframe.html</strong> has this code:</p>

<pre><code>&lt;frameset&gt;
&lt;frame id="mypage" src="mypage.html"&gt;
&lt;/frameset&gt;
</code></pre>

<p><strong>mypage.html</strong> has all this code:</p>

<pre><code>&lt;!DOCTYPE HTML&gt;
&lt;html&gt;
&lt;head&gt;
&lt;/head&gt;
hello world!
&lt;/html&gt;
</code></pre>

<p>I want to get all the HTML code of the mypage.html from within the main.html page, but I fail. What is the problem with the way I do it?</p>
