I have one ajax function, which may fail sometimes. I want to handle it by recalling the same ajax function.
My function:
$.ajax({
url: url,
data: data,
dataType: "html",
timeout:60000
}).done(function(content)){
container.html(content);
}).fail(function(jqXHR, status, error)) {
$.ajax(this);
}
When I execute the above function, the fail callback executing only once, I want it to be executed until it gets a success.