var urls = [url_1, url_2, errorUrl, url_4];
$.when.apply($, urls.map(function(url) {
return $.ajax({
url :url,
success: function( data, status ){
console.log(data)
},
error: function(data, status){
console.log('error')
}
});
})).catch(function(e) {
console.log(e)
})
.done(function() {
var results = [];
for (var i = 0; i < arguments.length; i++) {
results.push(arguments[i][0]);
}
Hi,
As above codes, I want to have one array objects from multiple urls ajax requests. Each urls will returns json Object. except one url which is error url return as 500. not 200.
My problem is if there is one error url . My codes is not working. It return as
[undefined, "e", "I"]
Is any way to ignore the error urls from my codes?
Please help me on this. Appreciate it.