Skip to content

Instantly share code, notes, and snippets.

@romanoffs
Last active August 13, 2017 09:22
Show Gist options
  • Save romanoffs/cf3d3455714a62147fc5e5052d78a0ea to your computer and use it in GitHub Desktop.
Save romanoffs/cf3d3455714a62147fc5e5052d78a0ea to your computer and use it in GitHub Desktop.
Аякс отправка форм
//Аякс отправка форм
//Документация: http://api.jquery.com/jquery.ajax/
$("#form").submit(function() {
$.ajax({
type: "POST",
url: "mail.php",
data: $(this).serialize()
}).done(function() {
alert("Спасибо за заявку!");
setTimeout(function() {
$("#form").trigger("reset");
}, 1000);
});
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment