Created
October 2, 2017 21:55
-
-
Save luisciphere/2ba89628d9a7287f15a7a36459882490 to your computer and use it in GitHub Desktop.
Simple jQuery ajax request
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
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