Bug Tracker

Modify

Ticket #13276 (closed bug: fixed)

Opened 15 months ago

Last modified 15 months ago

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:
Blocking: Blocked by:

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

comment:1 Changed 15 months ago by rwaldron

  • Owner set to rwaldron
  • Status changed from new to assigned
  • Milestone changed from None to 1.9.1

Confirmed. Patch to follow...

comment:2 Changed 15 months ago by rwaldron

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

comment:3 Changed 15 months 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 15 months 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 15 months ago by rwaldron

Julian, do you want to take this?

comment:6 Changed 15 months ago by jaubourg

  • Owner changed from rwaldron to jaubourg
  • Priority changed from undecided to high
  • Component changed from unfiled to ajax

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

comment:7 Changed 15 months ago by dmethvin

Probably about a week?

comment:8 Changed 15 months ago by jaubourg

  • Status changed from assigned to closed
  • Resolution set to fixed

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 15 months 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 15 months ago by jaubourg

I could only exhibit the bug in IE9 btw.

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.