Note that there are some explanatory texts on larger screens.

plurals
  1. POIE acts wierd with my javascript background changing code. Why?
    text
    copied!<p>Currently, I making a website as a personal project of mine. I've tested my javascript out and it works fine on both chrome and firefox. But when I test it in IE, only part of the code works. What's weird is that when I press f12 and open up developer tools, the code runs perfectly! Work's just as it should, with no errors what so ever.</p> <p>Here's my javascript:</p> <pre><code>var state_Clicked = false; var List = document.createElement("div"); function gearClick() { if(state_Clicked == true) { List.parentNode.removeChild(List); state_Clicked = false; } else { List.setAttribute("id", "containBox"); List.setAttribute("class", "bgChooserBox"); List.innerHTML = '&lt;span class="thumback"&gt;&lt;img onMouseDown="changeBackground(\'RD1_SlurpyNom.jpg\');" class="thumb" src="GRAPHICS/bg/RD1_SlurpyNom.jpg" width="100" height="100" /&gt;&lt;/span&gt; \ &lt;span class="thumback"&gt;&lt;img onMouseDown="changeBackground(\'FS1_SlurpyNom.jpg\');" class="thumb" src="GRAPHICS/bg/FS1_SlurpyNom.jpg" width="100" height="100" /&gt;&lt;/span&gt; \ &lt;span class="thumback"&gt;&lt;img onMouseDown="changeBackground(\'AJ1_SlurpyNom.png\');" class="thumb" src="GRAPHICS/bg/AJ1_SlurpyNom.png" width="100" height="100" /&gt;&lt;/span&gt; \ &lt;span class="thumback"&gt;&lt;img onMouseDown="changeBackground(\'PP1_SlurpyNom.png\');" class="thumb" src="GRAPHICS/bg/PP1_SlurpyNom.png" width="100" height="100" /&gt;&lt;/span&gt; \ &lt;span class="thumback"&gt;&lt;img onMouseDown="changeBackground(\'R1_SlurpyNom.jpg\');" class="thumb" src="GRAPHICS/bg/R1_SlurpyNom.jpg" width="100" height="100" /&gt;&lt;/span&gt; \ &lt;span class="thumback"&gt;&lt;img onMouseDown="changeBackground(\'TS1_SlurpyNom.jpg\');" class="thumb" src="GRAPHICS/bg/TS1_SlurpyNom.jpg" width="100" height="100" /&gt;&lt;/span&gt; '; document.getElementsByTagName("body").item(0).appendChild(List); state_Clicked = true; } } function changeBackground(name) { console.log('/GRAPHICS/bg/' + name); document.getElementById("body").style.backgroundImage = 'url(/GRAPHICS/bg/' + name + ')'; document.getElementById("logo").style.opacity = '0.4'; } </code></pre> <p>Any help would be greatly appreciated.</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