Bug Tracker

Opened 5 years ago

Closed 5 years ago

#15183 closed bug (duplicate)

appendTo not working when appending to head in IE8

Reported by: sylvaincourcoux Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.11.1
Keywords: Cc:
Blocked by: Blocking:

Description

Hi,

I have this simple script that creates a stylesheet and appends it to the head:

function Start() {
    
    var TheCSS = 'body{background:red;}';
    
    $('<style type="text/css" rel="stylesheet"></style>')
				  .html(TheCSS)
				  .appendTo("head");
}



$(Start);

As you can see in this jsFiddle http://jsfiddle.net/mej4h/, it doesn't work in IE8.

Sylvain Courcoux.

Change History (1)

comment:1 Changed 5 years ago by gibson042

Resolution: duplicate
Status: newclosed

Duplicate of #9832.
This is not a documented use of the .html method, and in particular <style> elements don't contain HTML.

Note: See TracTickets for help on using tickets.