Javascript getElementById in separate JS file, src written with javascript
<p>i want someone to include a JS file of me which does something neat. I thought i put it up just like Google: you put a script tag in your source and the google js takes care of everything.
in my php file is this:</p>

<pre><code>echo '&lt;script type="text/javascript"
src="http://www.site.com/gadget.js"&gt;
&lt;/script&gt;';
</code></pre>

<p>i that gadget.js, i write a span:</p>

<pre><code>document.write('&lt;span id="GadgetPicture&gt;');
document.write('&lt;/span&gt;');
window.setTimeout('refreshImage();', 2000);
</code></pre>

<p>in the refreshImage function, i want to reference my span:</p>

<pre><code>document.getElementById("GadgetPicture");
</code></pre>

<p>But it gives me null...
Does anybody know why?</p>

<p>also, <code>document.getElementById("body")</code> also give null.</p>

<p>Michel</p>
