homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

Using placeholders for ad codes not working right

10+ Year Member

Msg#: 4339135 posted 6:25 pm on Jul 13, 2011 (gmt 0)

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?



WebmasterWorld Senior Member 5+ Year Member

Msg#: 4339135 posted 7:38 am on Jul 15, 2011 (gmt 0)

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.


10+ Year Member

Msg#: 4339135 posted 3:12 am on Jul 16, 2011 (gmt 0)

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

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved