Is it possible to set the source of an image using the javascript: pseudo-protocol?
<p>Basically, I have a context where I'm only allowed to create an image, but I want to run a script before I decide on the source, so I'm wondering if this is possible:</p>

<pre><code>&lt;img src="javascript:{load a remote script and run it to figure out the source}" /&gt;
</code></pre>

<p>The work-around that I've come up with is:</p>

<pre><code>&lt;img src="any-old-image.gif" onload="document.write('&lt;scr' + 'ipt src=\"http://mysite-script.js\"'&gt;&lt;/scr' + 'pt&gt;');" /&gt;
</code></pre>

<p>but I'm hoping something a little cleaner is possible.</p>

<p>P.S. I'm aware that "javascript:" is quote-unquote evil. This is a special situation.</p>
