Skip to content

Instantly share code, notes, and snippets.

@laser
Created April 21, 2014 22:31
Show Gist options
  • Save laser/11158813 to your computer and use it in GitHub Desktop.
Save laser/11158813 to your computer and use it in GitHub Desktop.
Receiving Error Code on Client
// Receiving Error Code on Client
var lastTodoId = 45;
$('#todos li').click(function(e) {
var $tgt = $(e.target), todoId = $tgt.prop('id');
TodoManager.deleteTodo(todoId, function(err) {
if (err.code === 1004) {
alert(err.message);
}
else {
$tgt.remove();
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment