The issue seems to be that IE (9-edge) is blocking only one part of my javascript that is being set. While I can drop security settings in order to display the desired effect, I can't ask users to do the same. I'm sure that there is something missing here since the rest of the code gets displayed correctly.
$.each(data.results.audio, function(key, val) {
var replace = val.mp3Url.replace('&', '&');
if (val.imgUrl) {
status = "style='background:";
switch (val.roadCondition) {
case "1":
status += "#4CAF50'"; // green
break;
case "2":
status += "#FFEB3B'"; // yellow
break;
case "3":
status += "#D32F2F'"; // red
break
case "4":
status += "black'"; // black
break;
default:
status += "white'"; // white
}
}
var items2 = "<div class='bt_icon z-depth-5 hvr-round-corners'" + status + "><p class='shine waves-effect waves-green hvr-round-corners'><img id='" + key + "' class='majors ' src='" + val.imgUrl + "' alt='" + val.name + "' title='" + val.name + "' data-audio='" + replace + "' /></p></div>";
$("#button_icons").append(items2);
if (first && !isDone) {
isDone = true;
var audio = document.querySelector("audio");
audio.src = replace;
audio.load();
}
items.push(items2);
});
NOTE: background-color has the same effect.
The rest of the code works fine except for the "status" variable getting set. Chrome, Firefox, and Safari all display correctly. But on IE, it seems that the above "status" code never gets injected. It does not appear in the dom in dev tools. The only way to get all the code to show is by dropping security settings to medium and reloading the page. Any explanations/fixes?