AJAX cross-domain request IE 8+

Geray Suinov picture Geray Suinov · Jul 9, 2013 · Viewed 10.5k times · Source

How to correct rewrite the Ajax request to make it work in IE 8 +, using XDomainRequest?

$.ajax({
    type: "GET",
    url: url,
    success: function(xml) {
        $('.post-msg').append(processXml(xml, config));
    },
    error: function(jqXhr, textStatus, errorThrown) {
        var errorMsg = "Request on url: " + url + " failed: " + textStatus + " error:" + errorThrown;
        alert(errorMsg);
    }
});

Answer

Mihail picture Mihail · Jul 9, 2013

Use this plugin for IE8-9 Xdomain support.

https://github.com/MoonScript/jQuery-ajaxTransport-XDomainRequest