I'm trying to refresh the web ads after a few seconds. The refresh code in javascript works very well but the ad code also in javascript does not appear after a refresh.
Ads works well only through iframe that the advertising system has as an option.
The reason why I like javascript ads is that they are responsive.
Advertising code:
<div class="ads">
var m3_u = (location.protocol=='https:'?'https://myweb.com/ads/www/delivery/ajs.php':'http://myweb.com/ads/www/delivery/ajs.php');
var m3_r = Math.floor(Math.random()*99999999999);
if (!document.MAX_used) document.MAX_used = ',';
document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
document.write ("?zoneid=1");
document.write ('&cb=' + m3_r);
if (document.MAX_used != ',') document.write ("&exclude=" + document.MAX_used);
document.write (document.charset ? '&charset='+document.charset : (document.characterSet ? '&charset='+document.characterSet : ''));
document.write ("&loc=" + escape(window.location));
if (document.referrer) document.write ("&referer=" + escape(document.referrer));
if (document.context) document.write ("&context=" + escape(document.context));
if (document.mmm_fo) document.write ("&mmm_fo=1");
document.write ("'><\/scr"+"ipt>");
</div>
Execution interval code:
setInterval("my_function();",3000);
function my_function(){
$('.ads').load(location.href + ' .ads');
}