Online Kredit ohne Schufa - Privatkredit - Free Advertising - ID badge templates - Skype - Debt Consolidation

PDA

View Full Version : Ads slow down page rendering... so


paulaa
Aug 15th 2007, 2:43 am
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.

briansol
Aug 16th 2007, 10:15 am
i put the ads last in my source and use CSS to position them where i want them.

paulaa
Aug 18th 2007, 11:02 pm
i put the ads last in my source and use CSS to position them where i want them.

yeah good call. that's what I ended up doing. works great.