I have multiple ajax requests some request data every minute others are initiated by the user through a ui.
$.get(\'/myurl\', data).done(function( data ){
The code below will keep the original request and it will try to success 3 times.
var tries = 0; $( document ).ajaxError(function( event, jqxhr, settings, thrownError ) { if(tries < 3){ tries++; $.ajax(this).done(function(){tries=0;}); } });