Open FiShelly opened 4 years ago
MDS tell us: The innerHTML property is read-only on the col, colGroup, frameSet, html, head, style, table, tBody, tFoot, tHead, title, and tr objects.
so:
The insertStyle function will get error in Ie8. By the way, document.head in Ie8 will get undefined.
document.head
solve:
function insertStyle (css) { if (!css) return; if (typeof (window) == 'undefined') return; var style = document.createElement('style'); if ('styleSheet' in style) { // to compatible IE8 style = document.createElement('div'); style.innerHTML = 'x<style>'+css+'</style>'; style = style.lastChild; } else { style.innerHTML = css; } var head = document.getElementsByTagName('head')[0]; head.appendChild(style); return css; }
MDS tell us: The innerHTML property is read-only on the col, colGroup, frameSet, html, head, style, table, tBody, tFoot, tHead, title, and tr objects.
so:
The insertStyle function will get error in Ie8. By the way,
document.head
in Ie8 will get undefined.solve: