Created
March 24, 2016 17:52
-
-
Save Yelakelly/62009c8e1da75c1a73d8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$('.js-send-form').submit(function(e){ | |
var postData = $(this).serializeArray(); | |
var formURL = $(this).attr('action'); | |
$.ajax( | |
{ | |
url: formURL, | |
type:"POST", | |
data:postData, | |
success:function(data) | |
{ | |
alert('Форма успешно отправлена!'); | |
}, | |
error:function() | |
{ | |
alert('Ошибка! Попробуйте позже.') | |
} | |
}); | |
e.preventDefault(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment