Seriously, what the flip is wrong with IE? It throws an “Object doesn’t support this property or method” error when i’m accessing XML data loaded via AJAX. I’ve spent the whole night trying to find the cause, but with no success.
Nothing wrong with the code, nothing wrong with the XML data, works fine every other browser, in fact it even works in IE9, but only when it’s running local, as soon as it’s in the internet zone it starts throwing errors. One could think that it’s the zone security settings, but it doesn’t even work with lowest security settings.
The debugger shows that the XML data was loaded and parsed sucessfully, it shows that data is of type IXMLDOMDocument2, where as locally it says it’s of type Document, having a look at the jQuery source shows that it’s probably using Microsoft.XMLHTTP locally, and otherwise XMLHttpRequest if available, so that might have something to do with it.
I can workaround this problem by loading the data as text, and using $.parseXML afterwards, but i’d really like to know what’s going on here, is this a known bug, or am i missing something else?
Example (using jQuery 1.8.2):
<?xml version='1.0' encoding='utf-8'?>
<root>
<child>child</child>
</root>
$.ajax({
url: 'test.xml',
dataType: 'xml',
success: function(data)
{
alert(data);
}
});
If you want to see ‘data’ as a string that can be alerted, do this:
If there is something else you are doing with the XML, we need to see what you are trying to do.
Based on what you posted (I downloaded it), this works in IE: