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.
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.
I have tried creating an element;
var element = document.createElement('div');
element.innerHTML = '<a href="'+url+'"><img src="'+path+'"></a>';
Does anyone have any idea how i can write the advert into the page, where the ad code was placed?
Thanks!
This is how I do it currently and it works just fine:
This is the code I offer to users to put on their websites
And in serve.php I just simply echo the ad image I want wrapped in an
<a>tag