I have a site that has 3 ads from an ad network inserted using document.write(‘<scr’+'ipt… but the ads are huge flash ad and the client is complaining the site is loading slow (because the ads are loading while the pages is rendering or sometimes not loading). Is there anyway to offset the script from executing until after load? I’ve tried to div.innerHTML = '<script src="… after the page has loaded, but that doesn’t work.
The only other thing I can think of is the place the ads at the end of the HTML and try and place them using absolute position to where they should be on the page (only will work with 2 of the ads)
Thanks.
Oh, and the result of the script that is written using write(), then writes the ad by using writeln(), so I can’ even do something like:
s = document.createElement(‘script’);
s.src = …;
document.getElementById(‘ad_top’).appendChild(s);
Well, it’s as close as you’ll get with that method. It works fine for me except I also get an undefined in there.
But you don’t need to use that anyways! You’re writting just what you want inside of it anyways. And should you need a variable of some sort, you wouldn’t use writeLn anyways.