caliman
Active member
Hi all -
I am trying to modify the responsive adsense code from resources to display banners from my banner server.
I think I am in the ballpark but I am having trouble with the getElementbyId line I believe. I cannot get the banner to generate.
Any help would be greatly appreciated. Thanks in advance,
caliman
I am trying to modify the responsive adsense code from resources to display banners from my banner server.
Code:
<xen:hook name="ad_header" />
<div id="ad_header">
<script type="text/javascript">
width = document.documentElement.clientWidth;
/* default 320 x 50 banner */
var sc = document.createElement('script');
sc.src = 'http://ads.domain.com/adpeeps.php?bf=showad&uid=101662&bmode=off&gpos=center&bzone=header-320&bsize=all&btype=3&bpos=default&btotal=1&btarget=_blank&bborder=0';
if(width > 483) {
sc.src = 'http://ads.domain.com/adpeeps.php?bf=showad&uid=101662&bmode=off&gpos=center&bzone=header-468&bsize=all&btype=3&bpos=default&btotal=1&btarget=_blank&bborder=0';
}
if(width > 743) {
sc.src = 'http://ads.domain.com/adpeeps.php?bf=showad&uid=101662&bmode=off&gpos=center&bzone=header-728&bsize=all&btype=3&bpos=default&btotal=1&btarget=_blank&bborder=0';
}
sc.type = 'text/javascript';
if(typeof sc['async'] !== 'undefined') {
sc.async = true;
}
document.getElementById('ad_header').innerHTML=sc;
</script>
</div>
I think I am in the ballpark but I am having trouble with the getElementbyId line I believe. I cannot get the banner to generate.
Any help would be greatly appreciated. Thanks in advance,
caliman
Last edited: