尝试使用默认浏览器模式作为'EDGE'进行AJAX调用时收到错误消息'Access is Denied' [英] Getting error message 'Access is Denied' when trying to make an AJAX call with the default browser mode as 'EDGE'

查看:92
本文介绍了尝试使用默认浏览器模式作为'EDGE'进行AJAX调用时收到错误消息'Access is Denied'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我们升级到了jquery 3.x 默认浏览器模式为EDGE。发布升级时,当我尝试在两个不同的域之间进行ajax休息调用时,会抛出错误消息"访问被拒绝"。使用默认的
浏览器作为'IE7'工作正常。当我们尝试使用IE7和EDGE从本地工作空间执行其余调用时,它也能正常工作。仅当域名不同且浏览器模式为"EDGE"时才会出现问题。



虽然这点出于CORS相关问题,AJAX调用甚至没有首先发起。当我尝试启动其余调用并监视F12开发人员工具选项下的网络参数时,没有注册任何调用或日志。很快
,因为我发起了 从网页休息调用,抛出错误信息。我可以看到在Internet的安全设置下启用了"保护模式"复选框,我们正在使用的目标域不是可信站点的一部分。请
在下面找到我的型号代码库。请求您提供协助。


       


$。ajax({

   url:http:// localhost:8082 /,

   type:'GET',



  ;          async:false,

   success:function(response,options){

   if(successCallback&&(typeof successCallback ==='function')){

   successCallback.apply( (callbackObj || this),[response,options]);

  }

  },

  错误:函数(jqXHR,例外){

   util.logFailureMessage(jqXHR);

   if(failureCallBack&&(typeof failureCallBack ==='function')){

          failureCallBack.apply((callbackObj || this),[jqXHR]);

           }

});




我还尝试将完整性设置  AppData \ LocalLow文件夹更新为LOW并尝试。但它仍然没有按预期工作。请求您提供协助。

解决方案

您好 Fazil
Sheik ,


从线程的描述来看,看起来跨域请求导致了这个问题。


我建议你参考下面的链接可能有帮助你可以解决你的问题。


针对IE,Firefox,Chrome,Safari的jSON响应的跨域Ajax请求 - jQuery


免责声明:此响应包含对第三方万维网站点的引用。 Microsoft提供此信息是为了方便您。 Microsoft不控制这些网站,也未测试在这些网站上找到的任何软件或信息;因此,Microsoft不能就其中发现的任何软件或信息的质量,安全性或适用性做出任何陈述。使用互联网上的任何软件都存在固有的危险,并且Microsoft提醒您在从互联网上检索任何软件之前确保您完全了解风险的


问候


Deepak


Recently we upgraded to jquery 3.x  with the default browser mode as EDGE. Post the upgrade, error message 'Access is denied' is thrown when I try to make an ajax rest call between 2 different domains. The same is working fine with the default browser as 'IE7'. Also it works fine when we try to execute the rest call from local work space with IE7 and EDGE. Issue occurs only when the domains are different and the browser mode as 'EDGE'.

Although this points out to CORS related issue, AJAX call is not even initiated in first place. When i try to initiate the rest call and monitor the Network parameters under F12 developer tools option, no calls or log is getting registered. As soon as I initiate the  rest call from the web page, the error message is thrown. I could see that the 'Protected mode' check box is enabled under security settings for Internet and the destination domain we are consuming is not part of the trusted site. Please find my model code base below. Requesting you assistance on the same.

       

$.ajax( {
    url: http://localhost:8082/,
    type: 'GET',

                    async: false,
    success: function(response, options) {
    if(successCallback && (typeof successCallback === 'function')){
    successCallback.apply((callbackObj || this), [response, options]);
    }
    },
    error: function (jqXHR, exception) {
   util.logFailureMessage(jqXHR);
    if(failureCallBack && (typeof failureCallBack === 'function')){
                failureCallBack.apply((callbackObj||this),[jqXHR]);
            }
}
});

I also tried to update the Integrity settings AppData\LocalLow folder to LOW and tried. But it still did not work as desired. Requesting you assistance on the same.

解决方案

Hi Fazil Sheik,

From the description of the thread, It looks like cross domain request cause this issue.

I suggest you to refer link below may help you to solve your issue.

Cross Domain Ajax Request with JSON response for IE,Firefox,Chrome, Safari – jQuery

Disclaimer: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

Regards

Deepak


这篇关于尝试使用默认浏览器模式作为'EDGE'进行AJAX调用时收到错误消息'Access is Denied'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆