-1
How can I make nothing change after sending ajax, the page stay in the same place and not be loaded again?
script
$(function() {
$('.form-carro').submit(function(){
$.ajax({
url:'insert.php',
type: 'post',
data: $('.form-carro').serialize(),
success: function (data) {
$('.recebeDados').html (data);
}
});
return-false
});
});
would just have to take the success
?
Hello Pedro, your question is unclear. You have a syntax error ``
return-false
that you can simultaneously remove, and I imagine you need to$('.form-carro').submit(function(e){ e.preventDefault();
to prevent the form from reloading the page. That’s it?– Sergio
Good, it worked, I just took the
return-false
and changed the$('.form-carro').submit(function(){
for$('.form-carro').submit(function(e){ e.preventDefault();
, thank you very much– Pedro Henrique Kuzminskas