Skip to content

Instantly share code, notes, and snippets.

@mikekavouras
Last active August 29, 2015 14:10
Show Gist options
  • Select an option

  • Save mikekavouras/c5421e62abb06fa4ed16 to your computer and use it in GitHub Desktop.

Select an option

Save mikekavouras/c5421e62abb06fa4ed16 to your computer and use it in GitHub Desktop.
function signup(successCallback) {
$.ajax({
url: 'http://signup.com',
type: 'post',
data: {username: "butt"},
success: function(response) {
successCallback(response.user);
},
error: function() {
alert('well...');
}
});
}
$('#button').bind("click", function() {
signup(function(newUser) {
alert('welcome, ' + newUser.username);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment