0
I would like to add a successfully edited message via JS after reloading the page. The message is displayed before reloading the page and not before.
Follows my code:
Call AJAX:
var resposta = $.ajax({
url: url,
method: 'POST',
contentType: 'application/json',
data: JSON.stringify(
{
id: idProjeto,
nome: nomeProjeto,
resumo: resumoProjeto,
dataInicio: dataInicioProjeto,
dataFim: dataFimProjeto
}
),
error: onErroSalvandoProjeto.bind(this),
success: onProjetoSalvo.bind(this)
});
These are my duties:
function onProjetoSalvo(){
location.reload();
insertPrimaryAlert();
}
function insertPrimaryAlert(){
var alertPrimary = '<div class="alert alert-info"> Projeto editado com sucesso! </div>';
document.getElementById('alertas').innerHTML = alertPrimary;
}
Got it, I’m new here at Stack, I’m still meeting. I’ll take the solved and the answer I’ve accepted.
– Jacson Modell