Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#13276 closed bug (fixed)

In IE 9/10 $.parseXML() returning document object instead of XMLDOMDocument

Reported by: yogistra@… Owned by: jaubourg
Priority: high Milestone: 1.9.1
Component: ajax Version: 1.9.0
Keywords: Cc:
Blocked by: Blocking:

Description

Ironically this is because IE 9 and 10 are more standards compliant.

The situation occurs when performing XML manipulations(specifically copying nodes between objects).

Copying nodes between an XML document returned via an Ajax call and an XML document returned from .parseXML results in a type mismatch error in IE 9/10.

It works correctly in IE8.

Please find below the test condition showing nodes successfully copied in all browsers (including IE 8) but failing in 9 and 10.

http://jsfiddle.net/yogistra/HLMZD/

Change History (10)

comment:1 Changed 10 years ago by Rick Waldron

Milestone: None1.9.1
Owner: set to Rick Waldron
Status: newassigned

Confirmed. Patch to follow...

comment:2 Changed 10 years ago by Rick Waldron

Interesting, when you change the dataType to "text" and manually use jQuery.parseXML on the response text, it works fine.

comment:3 Changed 10 years ago by dmethvin

Right because the "built-in" XML in XHR isn't the same document type. I am sure some amount of fury will rain down on us if we use this simple patch but I don't know the implications.

comment:4 Changed 10 years ago by jaubourg

We already switched to text only requests in 2.0's xhr transport so we may as well do so in 1.9.

comment:5 Changed 10 years ago by Rick Waldron

Julian, do you want to take this?

comment:6 Changed 10 years ago by jaubourg

Component: unfiledajax
Owner: changed from Rick Waldron to jaubourg
Priority: undecidedhigh

Let me handle it then. What's the timeframe for 1.9.1?

comment:7 Changed 10 years ago by dmethvin

Probably about a week?

comment:8 Changed 10 years ago by jaubourg

Resolution: fixed
Status: assignedclosed

Never use the XML as parsed by the XHR instance. Use raw text instead and let the ajax conversion logic do the trick. -20 min/gzipped. Fixes #13276. Unit test added.

Changeset: b83081ba644b70876a64b3abd7eb11109c1e7a1d

comment:9 Changed 10 years ago by jaubourg

Fixes #13276. Unit test is enough since the 2.x XHR transport already dismissed the XML as parsed by the XHR instance.

Changeset: 4c6fb65d358f6a9795f06ec8d5ed3acad6ad795d

comment:10 Changed 10 years ago by jaubourg

I could only exhibit the bug in IE9 btw.

Note: See TracTickets for help on using tickets.