这在 FF safari 和 chrome 中有效,但在 IE8 中导致错误
var styleText = "#" + containerElement.id + " button {background-color:" + options.bg_color + ";}";
styleText += "#" + containerElement.id + " button.not-open {color:" + options.txt_color + ";}";
styleText += "#" + containerElement.id + " button.not-open:hover {color:" + options.hvr_color + ";}";
styleText += ".info_pane {background-color:" + options.bg_color + ";}";
styleText += ".info_pane {color:" + options.txt_color + ";}";
styleText += ".info_pane a {color:" + options.txt_color + ";}";
var style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = styleText;
innerHTML 是引发错误的原因。完成这项工作的最佳选择是什么?我环顾四周,发现的大多数东西似乎有点不稳定