Visit me elsewhere:

Loading Google Adsense Ads After Page Loading – At The End

Using Google Adsense?

Placing one or more ads (close to) the top of the page?

Tired of those uber-long loading times vastly increasing the load-time of your site?

Here’s a solution.

Of course, also works with other ad services or whatever.

After fiddling with javascript and such, I finally managed to do it with an <object> and load the ads.

With jQuery it’s really easy.

First, place the <object> Tag wherever you want the ad to be, best also defining its size, so it will display even without ads with the right size and not have to be resized:

<object class="ad_something" width="728" height="90" data="" type="text/html"></object>

For the ads I made a small PHP script, checking GET parameters and loading the corresponding ad.

Then, at the bottom of the page, right before , add your JS code:

<script type="text/javascript">
  $('document').ready(function(){
    $('.ad_something').attr('data', 'ads.php?get=ad_something')
  })
</script>

or similiar.

Of course, you can also do this without jQuery.

Now, when the page has finished loading it will then load the ads.

Wonderful!