【发布时间】:2016-12-03 01:38:42
【问题描述】:
我正在尝试通过 ajax jQuery 的方法从跨域服务器检索 XML,控制台上出现以下错误消息:
DOMException: Failed to execute 'send' on 'XMLHttpRequest': Failed to load: 'http://foreign.domain/...'
带来这个错误的代码是:
var temp = $.ajax({
url : url,
async : false
dataType : "xml",
success : function(xml) {
// irrelevant for the case
},
error : function(xhr, textStatus, error) {
console.warn('An error occured while loading the following URL: "%s". Error message: %s', url, error);
}
});
【问题讨论】:
标签: jquery ajax xml google-chrome asynchronous