在360兼容模式IE10及以下测试ajax请求会返回没有权限的问题,使用的layui内部集成的jquery。不过我的是跨域请求,
AJAX请求的option如下
{
[functions]: ,
async: true,
cache: true,
contentType: "application/x-www-form-urlencoded",
dataType: "json",
headers: { },
processData: true,
url: "",
url_prefix: true
}
已开启cors设置
jq.support.cors=true;
返回的json如下
{readyState: 0, responseJSON: undefined, status: 0, statusText: "Error: 没有权限"}
请问应该如何解决?
CORS 规范(即 XMLHttpRequest Level 2)是 HTML5 时才制定出,IE 早期版本(IE 10.4 以前)并不支持。
不过 IE 自己有一个私有对象
XDomainRequest
,可以用它,不过好像最低只支持到 IE 8。更古早的 IE 6/7 你只能用 jsonp 或是后端配代理转发来处理跨域请求了。