I ran into a very vague error while doing some simple jQuery DOM manipulation.
The line that triggered the error is the following:
$(this).closest(\'tr\')
I don't know what you expect the value of this to be in your "success" handler, but I bet it's not what you think. Save this outside the "$.ajax()" call:
this
var clicked = this; $.ajax( // ... success: function(res) { if (res) { $(clicked).closest('tr').remove(); } else { // ... } } );