Javascript 将xmlHttp响应类型设置为msxml文档会在IE11中引发无效状态错误

Javascript 将xmlHttp响应类型设置为msxml文档会在IE11中引发无效状态错误,javascript,Javascript,尝试将XMLHTTPRequest对象responsetype设置为“ms xml”时,出现无效状态错误。有人知道为什么吗? 我附加了一些示例代码,用于创建对象和设置responseType属性。 谢谢 请在打开后尝试设置responseType,然后重试 this._xmlhttp.open("POST", this.uri, this.async); try { this._xmlhttp.responseType = 'msxml-document'; } catch (e) {}

尝试将XMLHTTPRequest对象responsetype设置为“ms xml”时,出现无效状态错误。有人知道为什么吗? 我附加了一些示例代码,用于创建对象和设置responseType属性。 谢谢


请在打开后尝试设置responseType,然后重试

this._xmlhttp.open("POST", this.uri, this.async);
try {
    this._xmlhttp.responseType = 'msxml-document';
} catch (e) {}
...
它取决于设置responseType时XmlHttpRequest的状态

this._xmlhttp.open("POST", this.uri, this.async);
try {
    this._xmlhttp.responseType = 'msxml-document';
} catch (e) {}
...