Assuming you have a LI structure (or something similar):
<ul> <li>Some text <a href="delete.php?do=user">delete</a></li> <li>Some text <a href="delete.php?do=event">delete</a></li> <li>Some text <a href="delete.php?do=recipe">delete</a></li> </ul>
You can do it
$('.delete').click(function(){ var t=$(this); jQuery.ajax({ type: "GET", url: t.attr('href'), cache: false, success: function(data){ t.parent().remove();
Of course, if you need to run a different function for ajax success, then your paths, which I consider to be the best choice.
source share