本文介绍了jQuery跨域请求失败“拒绝访问”在IE中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hello There,
My Ajax cross domain request is failing in IE 11 with "Access denied". I have read through several posts regarding this topic, and done below changes but getting same issue.
1) Call is async=false, dataType='json' and crossDomain, cache is false.
These are the prerequisites I have found.
2) Works in latest Firefox and Chrome.
jQuery.support.cors is true
Why is this failing with Access denied? Any idea?
I have tried with JSONP and here i am not getting "Acces Denied" error. But problem is, i can able to get the result into success function and the same passing to global variable. when call the global parameter outside of the success function, there it is coming "Undefined".
I have read through several posts regarding this issue also. FYR, was followed the below link.
<a href="http://stackoverflow.com/questions/26668290/jquery-javascript-store-ajax-jsonp-response-into-variables">Link</a>[<a href="http://stackoverflow.com/questions/26668290/jquery-javascript-store-ajax-jsonp-response-into-variables" target="_blank" title="New Window">^</a>]
Can any one please help me.
Thanks in advance
Regards,
K N R
推荐答案
<system.webServer>
<httpProtocol>
<customHeaders>
<!--
Allow Web API to be called from a different domain.
-->
<add name="Access-Control-Allow-Origin" value="*" />
</customHeaders>
</httpProtocol>
</system.webServer>
这篇关于jQuery跨域请求失败“拒绝访问”在IE中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!