在 Internet Explorer(7 和 8)中使用此 ajax 请求时出现解析器错误。我正在使用 jquery 1.4.1
$.ajax({
url: 'data.xml',
dataType: 'xml',
contentType: 'text/xml', // also tried application/xml
success: doFunction
});
我在其他地方读到我应该设置内容类型,但我不知道在哪里。上面代码示例中设置的 contentType 参数没有做任何事情(我可以省略它,没有变化)。
我可以将内容类型设置为 <meta> 标签吗?我试过了,但是 XML 不会验证。
对此有什么想法吗?