Writing an image/swf onto page from external script
<p>I am currently messing around with some code for an advertising network, i have the main PHP back end complete but am struggling with the actual serving of the advert/image/swf.</p>

<p>I have tried using document.write, but this seems to get rid of the whole body, which is expected. However, looking at other ad networks code, it seems some use this to.</p>

<p>I have tried creating an element;</p>

<pre><code> var element = document.createElement('div');

 element.innerHTML = '&lt;a href="'+url+'"&gt;&lt;img src="'+path+'"&gt;&lt;/a&gt;';
</code></pre>

<p>Does anyone have any idea how i can write the advert into the page, where the ad code was placed?</p>

<p>Thanks!</p>
