ie8中的XDomainRequest未指定错误

时间:2017-05-08 19:07:51

标签: javascript internet-explorer-8 xdomainrequest

我正在尝试在IE8中发出http GET请求。在使用jQuery时,这在所有其他浏览器和IE8中都可以正常工作,但不是本机方法。我也尝试了另一个端点,但没有运气。它返回的全部是“未指定的错误”。'在xdr.send()行的控制台中。

var xdr = new XDomainRequest();
xdr.open("get", 'http://localhost/jump/test');
xdr.onload = function () {
  alert("Loading");
  alert(xdr.responseText);
};
xdr.onsuccess = function() {
  alert("Success!");
  alert(xdr.responseText);
};
xdr.onerror = function() {
  alert("Error!");
  alert(xdr.responseText);
};
xdr.onprogress = function() {
  alert("Progress");
  alert(xdr.responseText);
};
xdr.timeout = 10000;
xdr.send();

0 个答案:

没有答案