Skip to content

Instantly share code, notes, and snippets.

@christianselig
Created August 16, 2013 19:34
Show Gist options
  • Save christianselig/6252860 to your computer and use it in GitHub Desktop.
Save christianselig/6252860 to your computer and use it in GitHub Desktop.
$(document).ready(function() {
$('input[type="submit"]').click(function() {
event.preventDefault();
var email = $('.email').val();
$.ajax({
type: "POST",
url: "register_email.php",
dataType: "json",
data: { email: email },
success: function(data) {
alert(data.email);
},
error: function(jqXHR, textStatus, errorThrown) {
alert(textStatus + " " + errorThrown);
}
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment