Skip to content

Commit

Permalink
fixed 'unknow runtime error' ie IE8
Browse files Browse the repository at this point in the history
  • Loading branch information
wisely0515 committed May 28, 2015
1 parent 48eed00 commit 278b9ba
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/helpers/injectCSS.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,15 @@ function injectStyle(css) {
if (!style) {
style = document.createElement('style');
style.setAttribute('id', 'rackt-style');
var head = document.getElementsByTagName('head')[0];
head.insertBefore(style, head.firstChild);
style.setAttribute("type", "text/css");
}

if (style.styleSheet) {
style.styleSheet.cssText = css;
document.body.appendChild(style);
} else {
style.innerHTML = css;
document.head.appendChild(style);
}
style.innerHTML = style.innerHTML+'\n'+css;
}

0 comments on commit 278b9ba

Please sign in to comment.