Bug Tracker

Modify

Ticket #4961 (closed bug: invalid)

Opened 4 years ago

Last modified 2 years ago

$('<style/>').append('styles') throws error in IE

Reported by: james_padolsey Owned by:
Priority: minor Milestone: 1.4
Component: manipulation Version: 1.3.2
Keywords: Cc:
Blocking: Blocked by:

Description

Try this:

$('<style type="text/css"/>').append('body{background:red;}')

Throws a runtime error in IE (6/7).

Instead of appending the text node the styles need to be added via --styleElement.styleSheet.cssText--

Change History

comment:1 Changed 3 years ago by dmethvin

  • Component changed from unfiled to manipulation

I don't think this is a bug to be fixed, but I'll leave it open until we can find some place to document it.

comment:2 Changed 3 years ago by snover

  • Keywords style needsdocs added; style, removed
  • Status changed from new to closed
  • Resolution set to invalid

comment:3 Changed 2 years ago by dmethvin

  • Keywords style append needsdocs removed

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.