I have a question about handling CORS prototypes with IE 10 browsers. I noticed that calling Ajax.Request on the cross-source URL in IE9 will fail by checking the access logs for the server so that it understands that the request was never done.
After some reading, it seems that IE8 / 9 should use its own object XDomainRequestto enable CORS, however, the Prototype function Ajax.getTransportreturns an object XMLHttpRequest, which, as I understand it, does not allow CORS in IE8 / 9?
I found a patch for jQuery for the same problem that tells me that this could also be a problem with Prototype, I just canβt find anything posted about it.
I implemented a bit of a hacker fix:
if (window.XDomainRequest) {
var xdr = new XDomainRequest();
xdr.open('POST', url);
xdr.onload = function () {
var data = xdr.responseText.evalJSON();
callback_handler(data.domain);
};
setTimeout(function(){
xdr.send();
}, 0);
} else {
new Ajax.Request(url,
{
method: 'post',
onSuccess: function(response)
{
var data = response.responseText.evalJSON();
callback_handler(data.domain);
}
}
);
};
... , - ( Prototype) ?