Skip to main content

Bug Tracker

Side navigation

#7833 closed bug (duplicate)

Opened December 23, 2010 11:19AM UTC

Closed December 23, 2010 06:58PM UTC

Last modified December 23, 2010 06:58PM UTC

$("<property/>").attr("k", "v") has no attribute on IE but $("<propert/>").attr("k", "v") has

Reported by: nicolas.albert@convertigo.com Owned by:
Priority: undecided Milestone: 1.6
Component: unfiled Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:
Description

Here the test case with jsfiddle

I want to create a DOM elements with attributes using JQuery, so I use the JQuery parser like that $("<elt/>").attr("k", "v"). Attributes are skipped using IE if the element is created by $("<property/>").

Tests 'a', 'c' and 'e' failed on IE (tested 7 & 8).

Execution result on IE :

a : <property></property>
a = <property akey="avalue"></property>


b : <propert bkey="bvalue"></propert>
b = <propert bkey="bvalue"></propert>


c : <parent><property></property></parent>
c = <parent><property ckey="cvalue"></property></parent>


d : <parent><propert dkey="dvalue"></propert></parent>
d = <parent><propert dkey="dvalue"></propert></parent>


e : <property><child eckey="ecvalue"></child></property>
e = <propert ekey="evalue"><child eckey="ecvalue"></child></propert>


f : <propert fkey="fvalue"><child fckey="fcvalue"></child></propert>
f = <propert fkey="fvalue"><child fckey="fcvalue"></child></propert>

On Firefox 3.6.x :

a : <property akey="avalue"></property>
a = <property akey="avalue"></property>

b : <propert bkey="bvalue"></propert>
b = <propert bkey="bvalue"></propert>

c : <parent><property ckey="cvalue"></property></parent>
c = <parent><property ckey="cvalue"></property></parent>

d : <parent><propert dkey="dvalue"></propert></parent>
d = <parent><propert dkey="dvalue"></propert></parent>

e : <property ekey="evalue"><child eckey="ecvalue"></child></property>
e = <propert ekey="evalue"><child eckey="ecvalue"></child></propert>

f : <propert fkey="fvalue"><child fckey="fcvalue"></child></propert>
f = <propert fkey="fvalue"><child fckey="fcvalue"></child></propert>
Attachments (0)
Change History (2)

Changed December 23, 2010 06:58PM UTC by dmethvin comment:1

resolution: → duplicate
status: newclosed

The jQuery() method is documented to accept HTML, not XML. Some browsers will try to parse what they are passed but IE is not one of them.

Changed December 23, 2010 06:58PM UTC by dmethvin comment:2

Duplicate of #6693.