Created
November 30, 2016 11:58
-
-
Save Jenya476/cb28bc892b1f5142513e71f894367356 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, #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