Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#7833 closed bug (duplicate)

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

Reported by: nicolas.albert@… 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>

Change History (2)

comment:1 Changed 12 years ago by dmethvin

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.

comment:2 Changed 12 years ago by dmethvin

Duplicate of #6693.

Note: See TracTickets for help on using tickets.