Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Using placeholders for ad codes not working right



6:25 pm on Jul 13, 2011 (gmt 0)

10+ Year Member

Using the solution I found here: [webmasterworld.com...]

I am trying to set up my ad codes so that they are excecuted last using placeholders. Other solutions result in duplicate requests which I'm trying to avoid, but the code in the aforementioned thread does not work. The ads show, but they show at the bottom of the page without being removed to their proper places.

First I have the placeholder:

<div id="adbox"></div>


<div id="adboxloader" style="display:block;">{Lots of script text stuff here, unchanged from ad vendor}</div>
<script type="text/javascript">
var loader = document.getElementById('adboxloader');

This however never moves the ads, they simply load at the bottom of the page out of place. Any idea what might be going wrong here?


7:38 am on Jul 15, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

The ad vendor script may not have loaded the div by the time you move it.

For starters replace ad vendor script with static content and see if that works.

There are lots of tricks the ad vendor could be using, like waiting for onload, putting the script inside adbox may possibly be fastest loading option.


3:12 am on Jul 16, 2011 (gmt 0)

10+ Year Member

Just tried static and it worked, you're right it must be ad related.

Featured Threads

Hot Threads This Week

Hot Threads This Month