2

I am trying to enable CORS for certain domains. I need to do this in my web.config file. I have tried THIS solution but I am not getting any responses from my AJAX call. I am able to get a response when I use only 1 value

<httpProtocol>
    <customHeaders>
        <add name="Access-Control-Allow-Origin" value="http://domain.edu" />
    </customHeaders>
</httpProtocol>

How can I use my web.config file to use certain domains? Is it possible? I am using JavaScript to make my AJAX call

$.ajax({
    method:"GET",
    url: 'http://domain.edu',
    crossDomain:true,
    success: function(result){
        alert('reply');
    },
    error: function(result, textStatus, errorThrown){
        alert('timeout/error');
        alert("Text Status: "+textStatus);
        alert("Error Thrown: " + errorThrown);
    }
});
Community
  • 1
  • 1
IE5Master
  • 413
  • 1
  • 3
  • 14

0 Answers0