Created
April 21, 2014 22:31
-
-
Save laser/11158813 to your computer and use it in GitHub Desktop.
Receiving Error Code on Client
This file contains hidden or 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
// 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