Question

I am building a Firefox extension and have come a long way. One of the parts of my extension is where I display a DIV at the bottom of the page and I want to put an ad into the div, but for some reason every time it does so, it redirects to another page entirely with the ad on it. So it looks like its not allowing me to insert this code below into the div that sits at the bottom. Any chance anyone can help?

This code of course calls the "ad_display.js" file and thats where it does the redirect. Any way I can do this or am I stuck in the water?

Thanks!!!

    <!-- Beginning of Project Wonderful ad code: -->
<!-- Ad box ID: 38154 -->
<script type="text/javascript">
<!--
var pw_d=document;
pw_d.projectwonderful_adbox_id = "38154";
pw_d.projectwonderful_adbox_type = "2";
pw_d.projectwonderful_foreground_color = "";
pw_d.projectwonderful_background_color = "";
//-->
</script>
<script type="text/javascript" src="http://www.projectwonderful.com/ad_display.js"></script>
<!-- End of Project Wonderful ad code. -->
Was it helpful?

Solution

Two solutions:

  • Either you replicate the functionality of that ad_display script, change "document.write(pw_s)" to something a little saner like "document.getElementById('mydivwithanad').innerHTML=pw_s"
  • Ether you use insert an iframe in the page rather than a div, and you inject that code in the iframe.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top