Skip to content

Commit

Permalink
Merge pull request reactjs#39 from wisely0515/ie8-support
Browse files Browse the repository at this point in the history
[fixed] 'unknow runtime error' in IE8
  • Loading branch information
mzabriskie committed Jul 15, 2015
2 parents 48eed00 + 278b9ba commit 669f3a8
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 669f3a8

Please sign in to comment.