How to load ADS after all remaining content

Asked

Viewed 31 times

0

I’m trying to make the Revive AD Server of my site (a forum on the Vbulletin platform) load only after all the content, this is because it is an external server, which ends up slowing down the site because the ADS is at the top of the page.

I’ve tried using the following options, and even 'works' when but when the ADS starts running the page turns all white, deleting the content that already loaded:

//Código para carregar o script no header da página.
<script>
    $.getScript(url);
</script>

//Código para chamar o script no block em que é encaixado o ADS no site.
$(window).bind("load", function() {

The full code that calls the ADS banner looks like this:

<head>
    <script type='text/javascript' src='http://site.com.br'></script>
</head>
<body>
    <script type='text/javascript'><!--//<![CDATA[
        var m3_u = (location.protocol=='https:'?'https://site.com.br':'http://site.com.br');
        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 ("?zone=zone");
        document.write ('&amp;cb=' + m3_r);
        if (document.MAX_used != ',') document.write ("&amp;exclude=" + document.MAX_used);
        document.write (document.charset ? '&amp;charset='+document.charset : (document.characterSet ? '&amp;charset='+document.characterSet : ''));
        document.write ("&amp;loc=" + escape(window.location));
        if (document.referrer) document.write ("&amp;referer=" + escape(document.referrer));
        if (document.context) document.write ("&context=" + escape(document.context));
        if (document.mmm_fo) document.write ("&amp;mmm_fo=1");
        document.write ("'><\/scr"+"ipt>");
    //]]>--></script>
    <noscript>
        <a href='http://site.com.br' target='_blank'>
            <img src='http://site.com.br' border='0' alt='' />
        </a>
    </noscript>
</body>
  • window.onload = Function() { //code here }

  • I tried and gave the same problem. The site starts to mount normal without ADS, but when it starts to load the content of ADS the screen is blank.

  • Maybe there’s a problem with the ads code. It does the same thing, only in a clean HTML file. Just the ads and something inside so you can notice if it turns white. If the same thing happens, it’s a problem with the ads code, if it doesn’t happen, it’s some incompatibility between the ads or window.load and the forum, and in the latter case, it can only solve "hunting" this incompatibility.

  • The fact of having a noscript in the code influences? because I’m putting only the js script inside the ONLOAD. I noticed when doing the proposed test that only noscript content loads on the page, so the question.

  • The noscript tag is only called if the browser has JS disabled.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.