Skip to content

Instantly share code, notes, and snippets.

@msmithstubbs
Last active December 21, 2015 23:29
Show Gist options
  • Select an option

  • Save msmithstubbs/6383082 to your computer and use it in GitHub Desktop.

Select an option

Save msmithstubbs/6383082 to your computer and use it in GitHub Desktop.
var create_callback = function(data) {
var msg = "Hm, there was an error. Sorry!";
if (data.status == 'OK') {
msg = 'Great! Stay tuned!';
} else {
var errors = [];
for(var i in data.errors) {
errors.push(data.errors[i]);
}
msg = errors.join("\n");
}
if ($('.sorry .message').length == 0) {
$('.sorry').append($('<div>', { 'class': 'message' }));
}
$('.sorry .message').html($('<h3>', { text: msg }));
}
$('#notify_button').click(function() {
BISPopover.create($('#notify_email').val(), 351612761).then(create_callback);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment