When I initialize an ajax call, when the request is succeeded and match a condition I want to re-call it again inside it, like following:
$.ajax({
...
success : function(){
if(true)
// run_this_request_again();
},
// or,
complete : function(){
if(true)
// run_this_request_again();
},
...
});
2
Answers
Create a
function
and place you ajax code in it. Call that function wherever you required.You can call
this
inside success with the ajax method.