You can use an alternative way:

var el = $('<style type="text/css"></style>').appendTo('head').attr({
                        media: media,
                        id:    id,
                        type:  'text/css'
                })[0];
                if(el.styleSheet !== undefined && el.styleSheet.cssText !==
undefined) { // IE
                        el.styleSheet.cssText = css;
                } else {
                        el.appendChild(document.createTextNode(css)); // Others
                        //el.innerHTML = css;
                };

Reply via email to