I'm getting a parsererror when using this ajax request in Internet Explorer (7 and 8). I'm using jquery 1.4.1
$.ajax({
url: 'data.xml',
dataType: 'xml',
contentType: 'text/xml', // also tried application/xml
success: doFunction
});
I read somewhere else that I should set the content type, but I don't know where. The contentType param set in the above code example doesn't do anything (I could leave it out, no change).
Can I set a Content Type as <meta> tag? I tried, but then the XML won't validate.
Any thoughts on this?
Ouch.. lame. it seemed that this problem occured because I opened the file in my browser by doubleclicking it in windows explorer.
Accessing it via a webserver (localhost) solved the problem.
Firefox didn't have the problem, because it is able to just open the file as if you were opening it yourself. IE really tries to do an a-synchronus request, but it has no server, so it fails.