[jQuery] Positioning ad
[jQuery] Positioning ad
We have articles on our site that are standard html (i.e. using p
tags).
We also use javascript to generate ad tags (i.e. doubleclick, adsense,
etc).
So I have a hidden div on the page that the ad is generated into (via
javascript). I then want to append the "ad" to the 3rd paragraph.
Everything works, except that as soon as I use jQuery to "move" it, I
have 3-5 more ads show up "randomly" on the page.
Here is the exact code that I am using. Is this a bug with
jQuery...or is it a limitation? I have never had problems positioning
actual html on the page...but since this is javascript it doesn't want
to work. To replicate just throw 5-10 paragraph tags on your page and
then place this code at the bottom.
Any workarounds?
Code:
<div id="article_ad" style="display:none">
<div style="float:left;display:inline;padding:0px 5px 5px 5px;margin:
5px 5px 5px -5px;text-align:center;border:1px solid #999">
advertisement<br />
<SCRIPT LANGUAGE="JavaScript">
document.write('<SCRIPT LANGUAGE="JavaScript1.1" SRC="http://
ad.doubleclick.net/adj/kansascity.inkkc/inkkc;template=cobrand;!
category=inkkc;pos=right2;sz=160x600;tile=25;ord=25?" ><\/SCRIPT>');
</SCRIPT>
</div>
</div>
<script type="text/javascript">
$("p:eq(3)").append($('#article_ad').html());
</script>