How can I share HTML markup between two different HTML files?
<p>I'm trying to build a simple extension for Opera 11 and I've hit a massive snag I'm sure most developers meet.</p>

<p>In case you don't know, an extension in Opera is just another .html file, with some Javascript if you choose.</p>

<p>What I'm having trouble with is getting the HTML source from the CALLING web page and passing it to the popup.html.</p>

<p>So for example, I'm on my Blog, I'd like to pass that markup and have that as the 'document' variable. Instead the 'document' variable is empty because it's using the popup.html's content - not the calling content.</p>

<p>How could I pass the HTML of the main browser to the popup.html?</p>

<p>Here is the code I have so you can see what I'm trying to do:</p>

<pre><code>&lt;script&gt;
    var imgs = document.getElementsByTagName('img')
    var t = "";
    for (var i=0, n=imgs.length;i&lt;n;i++) t += '&lt;br&gt;&lt;a href="'+imgs[i].src+'"&gt;&lt;img src="'+imgs[i].src+'" width="100"&gt;&lt;/a&gt;';
    document.write(t)
&lt;/script&gt;
</code></pre>
