如何使用XDomainRequest更正重写Ajax请求,使其在IE 8+中工作?
$.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);
}
});
使用此插件支持IE8-9 Xdomain。
https://github.com/MoonScript/jQuery-ajaxTransport-XDomainRequest