Note that there are some explanatory texts on larger screens.

plurals
  1. POFixed positioning an ad in IE
    text
    copied!<p><strong>Can skip to the edit for a more up to date explanation.</strong></p> <p>I can't seem to set an ad that gets written out via <code>document.write()</code> to a fixed position. It works fine in all other browsers besides IE, and that includes IE9.</p> <p>Here is an example: <a href="http://htinteractive.com/bottom_bar/demo.html" rel="noreferrer">http://htinteractive.com/bottom_bar/demo.html</a></p> <p>Any suggestions would be highly appreciated. I'm running out of ideas.</p> <p>Thank you.</p> <p><strong>Edit:</strong></p> <p>I've narrowed the problem down to the following IE issue I'm having. To simplify it down...</p> <pre><code>&lt;style type="text/css"&gt; #temp1 { position:fixed; bottom:0; height:100px; width:100px; border:solid 2px red; } &lt;/style&gt; &lt;!--WORKS IN IE--&gt; &lt;div id="temp1"&gt; &lt;script type="text/javascript"&gt; document.write("&lt;scr" + "ipt type=\"text/javascript\"&gt;\nif(typeof(cachebuster) == \"undefined\"){var cachebuster = Math.floor(Math.random()*10000000000)}\nif(typeof(dcopt) == \"undefined\"){var dcopt = \"dcopt=ist;\"} else {var dcopt = \"\"}\nif(typeof(tile) == \"undefined\"){var tile = 1} else {tile++}\ndocument.write('&lt;scr'+'ipt src=\"http://ad.doubleclick.net/adj/shz.bloomington/home;pos=728x90_1;' + dcopt + ';tile=' + tile + ';sz=728x90;ord=' + cachebuster + '?\"&gt;&lt;/scr'+'ipt&gt;');\n&lt;/scr" + "ipt&gt;"); &lt;/script&gt; &lt;/div&gt; &lt;!--FAILS TO FIX POSITION IN IE--&gt; &lt;script type="text/javascript"&gt; document.write('&lt;div id="temp1"&gt;'); document.write("&lt;scr" + "ipt type=\"text/javascript\"&gt;\nif(typeof(cachebuster) == \"undefined\"){var cachebuster = Math.floor(Math.random()*10000000000)}\nif(typeof(dcopt) == \"undefined\"){var dcopt = \"dcopt=ist;\"} else {var dcopt = \"\"}\nif(typeof(tile) == \"undefined\"){var tile = 1} else {tile++}\ndocument.write('&lt;scr'+'ipt src=\"http://ad.doubleclick.net/adj/shz.bloomington/home;pos=728x90_1;' + dcopt + ';tile=' + tile + ';sz=728x90;ord=' + cachebuster + '?\"&gt;&lt;/scr'+'ipt&gt;');\n&lt;/scr" + "ipt&gt;"); document.write('&lt;/div&gt;') &lt;/script&gt; </code></pre> <p>Anyways, I really need the <strong>2nd method</strong> to work, and I'm pulling my hair out trying to figure out how.</p> <p>Thanks.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload