2
I need to make an AJAX request after any other AJAX request.
However, using the method $(document).ajaxComplete()
, for example, the request would end in an infinite loop.
Is there any easier way to make this request without calling it after each of the others?
What this request does is pull backgrounds from the logged-in user in a database and display them in an HTML page.
Whenever the user modifies one of its issues, it is updated via AJAX as well, but old issues continue to appear on the page.
So I need that after each other request this be executed also to update the user backlog.
The request I want to execute is very 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);