javascript - Refreshing an ad-banner in a div container -
got webpage used voting on different pictures (voting-tool).
on page there 2 different ad-banners stored in div containers.
the ads loaded script fills divs ads. (just regular).
now problem ads should reload after 5 pictures clicked or after amount of time. option of page reload not possible. if page refreshed pictures start @ picture 1 again, not useful if viewer @ picture 10.
how can reload script / single div container on page page stays same , ads reload , show banner?
any appreciated.
note: i've tried with
document.getelementbyid("addboxone").innerhtml
it works fine text or pictures not script , with
document.write("")
while using document.write
whole page gets overwritten , not div itself. , cant figure out how rewrite / refresh adbox
edit: script of ad-banner
<div class="superbanner">
div ad-banner in , want reload
<script language="javascript"> if (typeof (wlrcmd) == "undefined") { var wlrcmd = ""; } if (typeof (adlink_randomnumber) == "undefined") { var adlink_randomnumber = math.floor(math.random() * 10000000000) } document .write('<scr' + 'ipt language="javascript" src="http://ad.de.doubleclick.net/adj/oms.skol.de/localnews_bilder;oms=localnews_bilder;reg=;nielsen=3b;dcopt=ist' + wlrcmd + ';sz=728x90;tile=1;ord=' + adlink_randomnumber + '?"><\/scr'+'ipt>'); </script> <noscript> <a href="http://ad.de.doubleclick.net/jump/oms.skol.de/localnews_bilder;oms=localnews_bilder;nielsen=3b;sz=728x90;tile=1;ord=1734775579?" target="_blank"><img src="http://ad.de.doubleclick.net/ad/oms.skol.de/localnews_bilder;oms=localnews_bilder;nielsen=3b;sz=728x90;tile=1;ord=1734775579?" border="0" width="728" height="90"></a> </noscript> <div class="clear"></div>
try using ajax instead of document.write. . doc.write remove in dom before adding new stuff..
$.ajax({ url: "http://ad.de.doubleclick.net/adj/oms.skol.de/localnews_bilder;oms=localnews_bilder;reg=;nielsen=3b;dcopt=ist", datatype: "script", cache: true,//this decide whether cache or no not add timestamp along request success: function(){}//in success handler can write code uses resources js file ensuring script has loaded before using });
Comments
Post a Comment