Bug Tracker

Opened 10 years ago

Closed 9 years ago

#4806 closed bug (worksforme)

Node creation using $(html) breaks in IE when tag string is unclosed and attrs are used

Reported by: dantman Owned by:
Priority: major Milestone: 1.4
Component: core Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:

Description

http://jsbin.com/ejote

   Test              ie7   ie8    opera  firefox  midori
<span></span>        Pass  Pass   Pass   Pass     Pass
<span />             Pass  Pass   Pass   Pass     Pass
<span/>              Pass  Pass   Pass   Pass     Pass
<span>               Pass  Pass   Pass   Pass     Pass
<span class=foo />   Pass  Pass   Pass   Pass     Pass
<span class=foo>     Fail  Fail   Pass   Pass     Pass
<span class="foo">   Fail  Fail   Pass   Pass     Pass

<span></span> <span /> <span/> <span> <span class=foo />

All work in ie7, ie8, opera, firefox, and midori.

<span class=foo> <span class="foo">

Fail in ie7 and ie8 while they work in firefox, midori, and opera.

Change History (2)

comment:1 Changed 10 years ago by dmethvin

What should jQuery do with malformed HTML? Since that is an error case, I don't think you should expect consistent behavior.

comment:2 Changed 9 years ago by dmethvin

Component: unfiledcore
Resolution: worksforme
Status: newclosed

The current api documentation clarifies that closing tags are required; this is mandated by use of the browser's underlying .innerHTML mechanism so we don't have a lot of control over that.

Note: See TracTickets for help on using tickets.