Last active
August 29, 2015 14:17
-
-
Save sshkarupa/0d929d9078391fca8d8a to your computer and use it in GitHub Desktop.
ajax submit form
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(e) { | |
e.preventDefault; | |
$.ajax({ | |
type: "POST", | |
url: "mail.php", | |
data: $(this).serialize() | |
}).done(function() { | |
alert("Спасибо за заявку!"); | |
setTimeout(function() { | |
}, 1000); | |
}); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment