I wrote small script to adding class where .done function is called, but this solution doesn't work.
$("#test").on("click", function() {
var test = "foo bar";
$.post({
type: "POST",
url: "test.php",
data: {
test: test
}
}).done(function() {
$(this).parent().parent().addClass("success");
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table>
<tr>
<td><a href="#" id="test">click me</a></td>
</tr>
</table>