Ads slow down page rendering... so

Discussion in 'JavaScript' started by paulaa, Aug 15, 2007.

  1. #1
    Google ads etc slow down my page rendering quite considerably so i did this

    Function is used in conjunction with the handy Prototype framework.

    function wideAd() {
    var f = $('tad');
    var g = $('wad');
    var h = $('sponsor');
    var k = $('had');
    f.innerHTML = g.innerHTML;
    h.innerHTML = k.innerHTML;
    }

    basically the f and h variables are the divs that are at the bottom of the page. g and k are variables at the top of the page.

    this way the ads are loaded right after the page loads... instead of the page waiting to load with the ads.

    is this the best way to do it though? I'm no expert at JavaScript but seeing as iframes don't work well... this seems to be the best route. Seems to work fine in just about every browser.
     
    paulaa, Aug 15, 2007 IP
  2. briansol

    briansol Well-Known Member

    Messages:
    221
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    110
    #2
    i put the ads last in my source and use CSS to position them where i want them.
     
    briansol, Aug 16, 2007 IP
  3. paulaa

    paulaa Peon

    Messages:
    33
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    yeah good call. that's what I ended up doing. works great.
     
    paulaa, Aug 18, 2007 IP