none
IE11 not initiating CORS request RRS feed

  • Question

  • By fiddling it seems IE11 does not make an ajax request if it is cross origin. FF and Chrome will at least make the request and throw an error if the resource API is not sending necessary headers. The resource API (Web API 2.0) in my case is adding required headers which will be helpful IF IE makes the request, but it doesn't.

    Client's JavaScript:

    jQuery.support.cors = true;
    
    $.fn.somePlugin = function () {
        $.ajax({
            url: apiUrl + '/articles/list/',
            type: 'GET',
            crossDomain: true
        }).done(
            function (data, textStatus, xhr) {
                console.log('hello world!');
            });
        return this;
    }

    The ajax request above works perfectly in Chrome and FF but not in IE11.

    I've tried:

    1. adding a reference to XDomainRequest.js without any effect.
    2. enabling cross origin request in IE Security options - even though it seems bizarre to do this on every client machine. Regardless, it made no difference.
    Monday, November 3, 2014 6:40 PM

All replies