相关疑难解决方法(0)

当ajax目标是localhost时,IE 10和11中的访问被拒绝

我正在尝试在互联网上的服务器(http)之间进行ajax调用.并将其定位到我自己的localhost.FF/Chrome/ETC ......有效.它只是一个IE问题.IM使用IE 11和10.

请求甚至没有完成."拒绝访问"立即被抛出.

这是代码.只为你看.

不是IE8和IE9中的经典HTTP/HTTPS错误.这是别的,但文档没有帮助.

$jq.ajax({
            contentType: 'application/json',
            url: url,
            dataType: 'json',
            crossDomain: true,
            beforeSend: function (xhr) {
                xhr.withCredentials = true; 
                xhr.setRequestHeader("Authorization", "Basic " + $jq.base64.encode(username and password));
            },
            success: function (data, status, headers) {},
            error: function (xhr, status, error) {}
Run Code Online (Sandbox Code Playgroud)

状态是0xhr对象和错误是"拒绝访问"

ajax xmlhttprequest cors internet-explorer-10 internet-explorer-11

38
推荐指数
2
解决办法
9万
查看次数