I need to make an AJAX request after any other AJAX request.
However, using the $(document).ajaxComplete()
method, for example, the request would end in an infinite loop.
Is there an easier way to do this request without calling it after each other?
What this request does is to pull pending user from a database and display it on an HTML page.
Whenever the user modifies one of their pending issues, it is updated via AJAX as well, but the old issues continue to appear on the page.
This is why I need to do this after every other request to update the pending issues as well.
The request I want to execute is pretty simple:
function sucesso(data, textStatus, jqXHR) {
var htmlPendencias = jqXHR.responseText;
$("#div-pendencias").text("");
$("#div-pendencias").append(htmlPendencias);
}
var conf = {
method: "post",
data: {opcao: 2},
success: sucesso,
dataType: "text"
};
$.ajax("logado", conf);