Reputation: 3651
I'm trying to retrieve an XML from a cross-domain server via the ajax jQuery's method and the following error message appears on the console:
DOMException: Failed to execute 'send' on 'XMLHttpRequest': Failed to load: 'http://foreign.domain/...'
The code that brings this error is:
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);
}
});
Upvotes: 2
Views: 19651
Reputation: 3651
The problem is the synchronous option specified by:
async: false,
This seems not to work in Chrome probably because of the specification of the jQuery's ajax method, which says:
Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation.
The strange of the situation is that Firefox and Internet Explorer seem to ignore that specification and they both perform the http request and return the XML result.
Upvotes: 4