Skip to content

Instantly share code, notes, and snippets.

@yuriitaran
Forked from agragregra/jQyery Form Ajax
Created February 4, 2018 11:48
Show Gist options
  • Save yuriitaran/6cc1edd38cf326efccac25bc696787d9 to your computer and use it in GitHub Desktop.
Save yuriitaran/6cc1edd38cf326efccac25bc696787d9 to your computer and use it in GitHub Desktop.
//Аякс отправка форм
//Документация: http://api.jquery.com/jquery.ajax/
$("#form, #form2").submit(function(e) {
e.preventDefault;
$.ajax({
type: "POST",
url: "mail.php",
data: $(this).serialize()
}).done(function() {
alert("Спасибо за заявку!");
setTimeout(function() {
$.fancybox.close();
}, 1000);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment