3

I've read the post and included the jquery.xdomainrequest.min.js after jQuery, but I still get the 'Access Denied' error response. This request does work in browsers, but doesn't work in ie 9. The server response headers include :

Access-Control-Allow-Origin:*
Cache-Control:no-cache
Content-Encoding:gzip
Content-Length:166
Content-Type:application/json; charset=utf-8

Javascript function executed:

function doStuff()
{
    $.support.cors = true;
    $.ajax({
        url: 'https://foo/bar',
        dataType: 'json',
        crossDomain: true,
        type: 'GET',
        contentType: 'application/json; charset=utf-8',
        success: function (data) {
            $.each(data, function (key, val) {
                doSomething();
            });
        },
        error: function (request, status, error) { alert(status + ", " + error); }
    });
}
Community
  • 1
  • 1
mishap
  • 8,176
  • 14
  • 61
  • 92
  • CORS is enabled on the server and works on other browsers? – abc123 Jun 23 '14 at 20:01
  • Yes. It does work on chrome and firefox and ie 10+, thanks. I thought Access-Control-Allow-Origin:* does meat the CORS is enabled on server. – mishap Jun 23 '14 at 20:03
  • 1
    @mishap Perhaps [CORS with jQuery and XDomainRequest in IE8/9](http://stackoverflow.com/questions/11487216/cors-with-jquery-and-xdomainrequest-in-ie8-9). The 4th and 7th restrictions discussed in the article seem most likely to apply here. – Jonathan Lonowski Jun 23 '14 at 22:47
  • @Jonathan Lonowski, removed it, same story. – mishap Jun 24 '14 at 12:51

0 Answers0