The use case would be if the response it gets isn’t what it wanted it can call itself again.
$.post(qrLoginAjax.ajaxurl, {
userID : '11234324'
},function( response ) {
if (response.userID != 'undefined'){
//do stuff
} else {
// call $.post again
}
});
How would I do that?
Thanks
You could do something like this:
But sending AJAX requests like this seems like a bad design decision in my opinion. You should ensure that you don’t get into an infinite recursion by using for example a number of retries counter.