Я пытаюсь выполнить Javascript-функцию в IE11, но я получаю InvalidCharacterError на appendChild.InvalidCharacterError с appendChild при onload только в IE
function fixWidth(){
var elems=document.getElementsByTagName("*");
for(e=0; e<elems.length; e++){
var eCurStyle = elems[e].currentStyle;
var l_minWidth = (eCurStyle.minWidth) ? eCurStyle.minWidth : eCurStyle.getAttribute("min-width");
if(l_minWidth && l_minWidth != 'auto'){
var shim = document.createElement("DIV");
shim.style.cssText = 'margin:0 !important; padding:0 !important; border:0 !important; line-height:0 !important; height:0 !important; BACKGROUND:RED;';
shim.style.width = l_minWidth;
shim.appendChild(document.createElement(" "));
elems[e].appendChild(shim);
}
}
}
window.onload = fixWidth;
Он корректно работает на IE8. Но не на IE11.