I have a function:
$(".delete").click(function() {
$.ajax({
url: "ServerHandler.ashx",
data: "mode=delete&item=" + $(this).attr("title"),
success: function() {
$(this).parent().parent().remove();
alert("hi");
}
});
});
I have a problem when I delete the parent object. It just does not disappear. I tried to hide – did not help.
Alert is called normal.
How to solve?
Sorry for bad English.
You’re inside another function with another
thisvalue by default. Pass thethisvalue from the outer function with the$.ajaxfunction as follows: