0

XDomainRequest 在状态为 200 时未给出响应

var httpRequest = new XDomainRequest();
httpRequest.open('POST', url, true);
httpRequest.send(xmlDocument);
alert(httpRequest.responseText);
return httpRequest;

它给出的响应文本为空。请指导我在哪里失踪。

4

1 回答 1

1

尝试做:

var httpRequest = new XDomainRequest();
httpRequest.onload=function() {
    alert(httpRequest.responseText);
}
httpRequest.open('POST', url, true);
httpRequest.send(xmlDocument);
于 2012-09-18T11:22:06.610 回答