Skip to content

Instantly share code, notes, and snippets.

@luisciphere
Created October 2, 2017 21:55
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 luisciphere/2ba89628d9a7287f15a7a36459882490 to your computer and use it in GitHub Desktop.
Save luisciphere/2ba89628d9a7287f15a7a36459882490 to your computer and use it in GitHub Desktop.
Simple jQuery ajax request
function ajax() {
var msg = $(".register").serialize();
$.ajax({
type: "POST",
url: "./mail.php",
data: msg,
success: function(data) {
$('#results').html(data);
console.log('форма отправлена');
},
error: function(xhr, str) {
alert("Ошибка!");
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment