Bug Tracker

Modify

Ticket #11620 (closed bug: wontfix)

Opened 14 months ago

Last modified 14 months ago

Creating custom element with inline attributes broken in IE

Reported by: c0d3rg1rl Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.2
Keywords: Cc:
Blocking: Blocked by:

Description

$('<content456 />').attr('id', 'content456') works.

$('<content789 id="content789" />') fails.

Testcase "fail":  http://jsfiddle.net/fuNth/

If "old school" document.createElement('content789') is used, it works with IE:

Testcase "old school":  http://jsfiddle.net/fuNth/1/

Discussion in IRC-channel pointed to a possible bug in createDocumentFragment or similar.

Change History

comment:1 Changed 14 months ago by rwaldron

  • Status changed from new to closed
  • Resolution set to wontfix

Creating "custom" elements in old IE is broken, which is why newer HTML5 elements must be specially created via shims. jQuery does some internal work to make it easy for manipulating HTML5 elements, but does not provide a mechanism for creating arbitrary elements in archiac browsers.

comment:2 Changed 14 months ago by c0d3rg1rl

Additional info for interested readers:

The above "fail" testcase does not work with IE7 and IE8 on Windows XP.

It does work with IE9 on Windows 7.

comment:3 Changed 14 months ago by dmethvin

Right, once the world gets to HTML5 there are very specific rules about how the document should be parsed in the face of unknown tags or syntax errors. Even so, it is not a good idea to make up your own tags outside of an XML document.

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.