#8416 closed bug (worksforme)
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); } });
Change History (11)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
http://jsfiddle.net/jaubourg/kxQLg/
The xml is undefined because it is null on the native xhr. Could you provide a proper test-case?
comment:3 Changed 12 years ago by
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
comment:4 Changed 12 years ago by
You do realize the xml is most probably already parsed and passed as the first parameter of the success callback, right?
comment:5 Changed 12 years ago by
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
comment:6 Changed 12 years ago by
Component: | unfiled → ajax |
---|---|
Resolution: | → worksforme |
Status: | new → closed |
OK, I tested this on my local webserver using IE9 and it worked flawlessly.
comment:7 Changed 12 years ago by
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
comment:8 follow-up: 9 Changed 12 years ago by
This test case works for me in IE8, does it work in IE9? I don't have it handy right now.
Does the problem only happen for locally loaded XML files?
comment:9 follow-up: 10 Changed 12 years ago by
Replying to dmethvin:
This test case works for me in IE8, does it work in IE9? I don't have it handy right now.
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
comment:10 Changed 12 years ago by
Hmm.. If I copy/paste the example and actually load a real xml file, locally the .responseXML is still "undefined"
jsFiddle test case: http://jsfiddle.net/n3vXu/
Kind regards, Yomodo