Skip to content

Instantly share code, notes, and snippets.

@Scordavis
Forked from agragregra/jQyery Form Ajax
Created May 2, 2017 20:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Scordavis/826f0d0a014791248d20b485a4bee4df to your computer and use it in GitHub Desktop.
Save Scordavis/826f0d0a014791248d20b485a4bee4df 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