2
我正在處理未知數量的ajax請求。該請求可能在404失敗。這導致整個鏈失敗。一個延遲失敗後還有辦法繼續嗎?
一個延遲失敗後還有辦法繼續嗎?
var deferreds = [];
// fill deferreds with a number of ajax requests.
$.when.apply($, deferreds)
.done(function(){
// handle done
}).fail(function(){
// handle fail
// would like to fix/resolve the failed deferred and continue with the rest
});
不與$ .when,當一個失敗,他們都失敗。儘管你可以創建自己的延期對象。 –