简体   繁体   English

获取访问被拒绝错误

[英]Getting Access Denied Error

Getting Access Denied Error on https in IE. 在IE中通过https获取访问被拒绝错误。 while executing ajax call (to my server1) response which has another ajax call While my Ajax call url is on http .By implementing cors I able to execute on http.Tried JSONP also but then it execute my response till it find another ajax call .How to solve ? 在执行具有另一个ajax调用的(对我的server1的)响应时,我的Ajax调用url在http上。通过实现cors,我也可以在http.Tried JSONP上执行,但是它执行我的响应,直到找到另一个ajax调用。怎么解决 ? below is on myserver1 下面是在myserver1上

alert('aaa');
var xhr2 = new XMLHttpRequest();
xhr2.open('GET', 'http://myserver2.com', true);
xhr2.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhr2.send();
xhr2.onload = function () {
    alert('fff');
    var appCreds = xhr2.responseText;
    alert(appCreds);
};
alert('xxx');

In addition to the trusted site requirement I found that the problem was not fixed until I used the same protocol for the request as my origin, eg my test site was hosted on a https but failed with any destination using http (without the s). 除了受信任的站点要求之外,我还发现问题没有得到解决,直到我对请求使用与原始站点相同的协议为止,例如,我的测试站点托管在https上,但是使用http(不带s)的任何目的地均失败。

This only applies to IE, Chrome just politely logs a warning in the debug console and doesn't fail. 这仅适用于IE,Chrome只会在调试控制台中礼貌地记录警告,并且不会失败。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM