admin管理员组文章数量:1327680
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);
}
});
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);
}
});
Share
asked Jul 9, 2013 at 14:00
Geray SuinovGeray Suinov
3,7013 gold badges17 silver badges19 bronze badges
4
- possible duplicate of Cross domain ajax request – Andrew Lewis Commented Jul 9, 2013 at 14:05
- Does the site support JSONP? I know jQuery does not support cors for IE 8 and 9 because the xmlhttprequest of these browsers do not support it and because all the quirks that e with the special object that IE 8 (and I think IE 9) have with CORS the jQuery team have descided not to create that other object. So if the site has JSONP then use that if it has CORS then write your own xhr request but will still be buggy in IE 8 or 9. – HMR Commented Jul 9, 2013 at 14:05
- 1 CORS with jQuery and XDomainRequest in IE8/9 has some very helpful background and library links. – apsillers Commented Jul 9, 2013 at 14:10
- @apsillers That concludes that CORS isn't worth considering when you want to support IE 8 and 9. The same conclusion the jQuery team came to and the reason why they don't use xDomainRequest. – HMR Commented Jul 9, 2013 at 14:15
1 Answer
Reset to default 5Use this plugin for IE8-9 Xdomain support.
https://github./MoonScript/jQuery-ajaxTransport-XDomainRequest
本文标签: javascriptAJAX crossdomain request IE 8Stack Overflow
版权声明:本文标题:javascript - AJAX cross-domain request IE 8+ - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742220763a2435412.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论