UPDATE: I highly recommend not investing in XDomainRequest, because it is a very poor implementation with many limitations. It basically only works for GET requests for servers other than ssl, so you can also use jsonp or something else.
I use CORS to invoke the cross-domain API, however Internet Explorer gives problems. CORS should be possible in IE8 and IE9 through an XDomainRequest object, however I cannot get the work to work.
JQuery refuses to provide native support for XDomainRequest, however several jQuery plugins are invited to add this support. This topic offers two such plugins: jQuery.XDomainRequest.js and the reported xdr.js. Afaik, plugins should automatically override jQuery.ajax behavior. I found another plugin here .
I posted small demo pages with the corresponding jQuery.XDomainRequest and xdr and jquery.ie.cors plugins that execute ajax requests on a CORS-enabled server. Pages work in Chrome and Firefox, however IE8 / 9 instantly throws a rejected resolved error (even before submitting a request). This MSDN message suggests adding another handler xhr.onprogress = function() {}; but I tried this and it doesn't work either.
Any clues what am I doing wrong? I also tested with IE8 now using the MS virtual server, but it has exactly the same problem.
Edit: OK, so I realized that part of the problem was that I used POST on top of HTTPS. XDomainRequest does not seem to allow CORS over HTTPS. I can switch to HTTP, but I really need POST.
Edit2: See this issue on github for a complete story. It turns out that when using HTTP POST xDomainRequest can encode the request body (arguments) only as text/plain . This pretty much makes it useless because everyone uses application/x-www-form-urlencoded or multipart/form-data .
jquery internet-explorer-9 cors xdomainrequest
Jeroen Jul 14 2018-12-12T00: 00Z
source share