Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
XML
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
Posted

1 solution

You will need to allow cross site origins in your webconfig file. This is simply done using the following tags in your webconfig. You can replace the "*" with the domain you are making the request from (the origin).

also make sure
crossDomain: true,
on your ajax request.

XML
<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>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900