Current Scenario:
Currently we aren't having Retry ajax methods. For Enhancing system's quality and functionality we should integrate Ajax Retry for Network Timeouts.
Sample code will be something like this
$.ajax({
url : 'someurl',
type : 'POST',
data : ....,
tryCount : 0,
retryLimit : 3,
success : function(json) {
//do something
},
error : function(xhr, textStatus, errorThrown ) {
if (textStatus == 'timeout') {
this.tryCount++;
if (this.tryCount <= this.retryLimit) {
//try again
$.ajax(this);
return;
}
return;
}
if (xhr.status == 500) {
//handle error
} else {
//handle error
}
}
});
Refer to this StackOverflow => https://stackoverflow.com/questions/10024469/whats-the-best-way-to-retry-an-ajax-request-on-failure-using-jquery
Current Scenario:
Currently we aren't having Retry ajax methods. For Enhancing system's quality and functionality we should integrate Ajax Retry for Network Timeouts.
Sample code will be something like this
Refer to this StackOverflow => https://stackoverflow.com/questions/10024469/whats-the-best-way-to-retry-an-ajax-request-on-failure-using-jquery