Test Case Boilerplate
Fork this way...
JavaScript
////ticket #11882
/// Otto Nascarella
/// [email protected]
$(function() {
var style = $('<style>').appendTo('head'),
rule = 'h1 {background-color: red; color: white}';
/// when I do:
style.html(rule);
/*
I got an error message from IE8 and lower
"Object does not have propriety or method"
cos instead of writing to innerHTML, which does
not exist it should write to styleSheet.
My workaround was:
if (style[0].styleSheet) {
style[0].styleSheet = rule;
} else {
style.html(rule);
}
*/
});