views:

1692

answers:

3

I have a page with Google Adsense ads. Content is to the left and ads are to the right. When the page is downloading it retrieves the content first and then start with the Google Adsense ads. During that time the rest of the page (footer images) is not fetched until the whole ad is completely downloaded.

How can I make all of my page (content, images) load first and the ad load last?

+3  A: 

You'll have to put the ad code at the bottom of your html (php, asp, whatever) page so that the browser requests that data last. Browsers read from the top of the document to the end of the document and request along the way. I don't think there's any way around that.

You can still place the ad near the top of the page using css. An absolute position, or some crazy floats might be able to do it.

Grant
+1. No need for "crazy" floats though. It is really easily doable with CSS. Take a look at HTML source of this page (one of my websites) for example: http://www.firebirdfaq.org/faq119. You'll see that content comes first, then the header, then the footer and ads in the end. All with simple CSS and without any floats.
Milan Babuškov
+2  A: 

I think the simplest way would be to use body onload to start a javascript timer which after say 5 seconds will then populate the html of a div placeholder.

If you want to wait for everything to load you will need to keep track of every image, etc in an array.

John
Use jQuery for this, rather than body.onload. jQuery is more relieable.
cdeszaq
It what way more reliable? jQuery uses the DOM 0 events under the hood because they are more reliable. Unless you mean the possibility of overwiting the onload?
meouw
A: 

Yep, this is the way to go. I've discussed it in more detail here, with examples:

http://semplicewebsites.com/google-ads

Ed