Last active
August 13, 2017 09:22
-
-
Save romanoffs/cf3d3455714a62147fc5e5052d78a0ea to your computer and use it in GitHub Desktop.
Аякс отправка форм
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Аякс отправка форм | |
//Документация: 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