Hello :)
I am designing a layout that looks like:
== header ==
== ad banner ==
== content ==
== footer ==
however the source code order is:
== content ==
== header ==
== footer ==
== ad banner ==
the idea and goal of all that is
load ad code in the very end so that the page doesnt get slowed down by external loaded javascripts
seo optimize the website due to SOC
so i did the header positioned absolute and the content with a margin-top to make room for the header. that works fine so i did the same with the ad banner.
looked good but the problem is: when someone view the page with adblock enabled or the ad doesnt load (maby because theres is currently no capaign running) there is a huge ugly gap.
so i just added a function to window.onload where i re-order the source using javascript
(pseudocode: overallcontainer.insertbefore(content.firstchild,adbanner)
)
in addition i do a check on the offsetheight of the ad banner div and set some padding according to it.
this works great, but my worries are that it may give problems with some ad providers.
- may there be conflicts with usage policies etc?
- may some ads stop working?
- is there a better way? how would you do it?
most providers state in their terms of service that you must not modify their code, which i clearly dont. but i mess around with the stuff around it.