I have a modal to dial friends, when the user clicks on dial, I call the onclick that makes the request for the controller.
I want to send a success message to the user, I have a div with display none and I want to make it visible when POST occurs.
However, with POST the page is reloaded and the div returns to display none without even the message.
<div class="alert alert-success" role="alert" style="display:none;">
Amigo marcado!</div>
function marcar(e){
$.ajax({
url: '/MarcarAmigo/MarcarAmigos/',
type: "POST",
cache: false,
data: {'publicacao': publicacao, 'amigos_marcados': amigos_marcados},
success: function () {
$(".alert").css("display", "block");
}
}); }