Hello Everyone,
My company sells ad space to various companies, some of which is through a third party. For various reasons, each advertisement is written using JavaScript. For example, if I need to write an ad to a particular div, it would be written the page as follows:
document.writeln("<div id=\\"someId\\">");
document.writeln("<a href=\\"somelink\\">");
document.writeln("<img src=\\"someimage.jpg\\" />");
document.writeln("</a>");
document.writeln("</div>");
I did not write this code, but for various reasons, this is how we need to write the ad to the page. However, for third party ads (which are referenced through yet another JavaScript file), it seems that the actual ad is being written to the page at a different time than the containing div, but only in IE. For example, the above code would become:
document.writeln("<div id=\\"someId\\">");
document.writeln("<script type=\\"text/javascript\\" src=\\"somescript.js\\">");
document.writeln("</script>");
document.writeln("</div>");
and would be output as
<div id="someId">
<script type="text/javascript" src="somescript.js">
</script>
</div>
.
.
.
<!-- code output by above js file: -->
<a href="someThirdPartyLink.html"><img src="someImage.jpg" /></a>
For some of our ads, this is causing some terrible design problems. As I mentioned above, I can’t change either of the JavaScript files, and I unfortunately can’t get the third party ad servers to place unique ID’s on their HTML elements.
Can you think of any way that I could get the output code from the second JS file to remain inside of the div created by the first JS file?
Thank you very much for your time and willingness to help.
-Matt