How to repeat rejected ajax promise, if i call my ajax inside returned promiseB(…) function like in that answer - first link - return promiseB(…).then(makeBhandler(…, resultA));
and have something like that inside promiseB(…):
-1 function promiseB(…){
return new Promise(function(resolve, reject) {
var xhr = new XMLHttpRequest();
xhr.onload = function () {
resolve(xhr.response);
}
xhr.open('GET', img_src);
xhr.responseType = 'blob';
xhr.send();
});
}
-2 function promiseB(…){
return $.ajax({
url: upload_url,
type: 'POST',
data: bulbSend,
dataType: 'json',
processData: false,
contentType: false,
});
}
-3 function promiseB(…){ return $.post('api', params.join('&')) }
so how can i stop continue to .then statement and repeat ajax inside promiseB
with some timeout? How to freeze chain continue, may be i need to use .done instead of .then?