« Real JS recursive dump!!! | Writing code »
Ads from different domains
By pavic | July 7, 2006
Why is this a problem?
I started this post earlier, now I am working on it.
(my attempts to bulid it on following way failed, because it seems that google is making its iframe inserted dynamically into dom, on body load event so I have other idea in mind, will work on it when I caught some time)
Ads from different domains takes time to load, often ad servers are overloaded, and it takes even more time than it should.
This can cause major issues in website loading process, especially if website uses javascript, that modifies DOM, and requires DOM to be completely loaded in order to start execution.
How to prevent this?
Make your ad load dynamically by creating ad element when your page loads.
How to do it?
Here is a sample
I recommend using jquery’s $(document).ready binding of load event, but if you don’t want to use jquery, then you can simply bind it onload of your page, like … rest of your code
myInsertAdsFunction should look like this:
function myInsertAdsFunction() {
var tmp = document.createElement(”SCRIPT”);
Humm…. from some reason ads are not showing, and I know who to ask…
Topics: PHP |
Comments are closed.

