Skip to main content

Bug Tracker

Side navigation

#8416 closed bug (worksforme)

Opened March 01, 2011 09:45PM UTC

Closed March 03, 2011 02:51PM UTC

Last modified March 14, 2012 12:38PM UTC

IE9 jqXHR.responseXML returns "undefined"

Reported by: anonymous Owned by:
Priority: undecided Milestone: 1.next
Component: ajax Version: 1.5.1
Keywords: Cc:
Blocked by: Blocking:
Description

Using jqXHR.responseXML method in IE9RC returns "undefined"

while FireFox 3.6.13 correctly returns: [object XMLDocument]

A simple .XML which is read locally:

<?xml version="1.0" encoding="utf-8"?>
<hello>
    <world>earth</world>
</hello>

Read by:

$.ajax({
    url: "hello.xml",
    dataType: "xml",
    complete: function(jqXHR) {
        alert("jqXHR.responseText = " + jqXHR.responseText);
        alert("jqXHR.responseXML = " + jqXHR.responseXML);
    }
});
Attachments (0)
Change History (11)

Changed March 01, 2011 10:03PM UTC by Yomodo <prana001@gmail.com> comment:1

jsFiddle test case: http://jsfiddle.net/n3vXu/

Kind regards,

Yomodo

Changed March 02, 2011 06:53AM UTC by jaubourg comment:2

http://jsfiddle.net/jaubourg/kxQLg/

The xml is undefined because it is null on the native xhr. Could you provide a proper test-case?

Changed March 02, 2011 07:39AM UTC by Yomodo comment:3

Hi,

I need to load a local .xml file, this can be done in FireFox but not in the IE's (also IE8).

In IE I now have to use .responseText first, followed by .loadXML() to creating an [object XMLDocument].

Yomodo

Changed March 02, 2011 05:35PM UTC by jaubourg comment:4

You do realize the xml is most probably already parsed and passed as the first parameter of the success callback, right?

Changed March 02, 2011 06:27PM UTC by anonymous comment:5

Most probably? Both the .success() and .complete() method return "undefined" in IE 8 and 9.

It just doesn't make any sense, both the xml and jQuery are valid.

Still in IE the result is not an XML object.

I really can't understand why, unless this is a bug in IE.

Yomodo

Changed March 03, 2011 02:51PM UTC by jaubourg comment:6

component: unfiledajax
resolution: → worksforme
status: newclosed

OK, I tested this on my local webserver using IE9 and it worked flawlessly.

Changed March 08, 2011 10:18PM UTC by Yomodo comment:7

Hi,

Could you please elaborate "what" worked flawlessly?

I guess you did not receive a "undefined" but an "[object XMLDocument]"

in Internet Explorer 9?

Regards,

Yomodo

Changed March 09, 2011 03:07AM UTC by dmethvin comment:8

This test case works for me in IE8, does it work in IE9? I don't have it handy right now.

http://jsfiddle.net/kxQLg/6/

Does the problem only happen for locally loaded XML files?

Changed March 20, 2011 12:55PM UTC by Yomodo comment:9

Replying to [comment:8 dmethvin]:

This test case works for me in IE8, does it work in IE9? I don't have it handy right now. http://jsfiddle.net/kxQLg/6/ Does the problem only happen for locally loaded XML files?

Hi, I'm so sorry. Just saw your reply.

YES, your fiddle examples also works in IE9!

I'm using this for .HTA's, so yes it would be locally loaded XML files.

Yomodo

Changed March 20, 2011 02:28PM UTC by Yomodo comment:10

Hmm.. If I copy/paste the example and actually load a real xml file, locally

the .responseXML is still "undefined"

Changed March 21, 2011 12:04PM UTC by anonymous comment:11

Please also see this ticket: http://bugs.jquery.com/ticket/8571