jquery pass parameter to ajax callback
$('.del').on('click', function () { var id = $(this).attr('id'); var url = '/m/g2_content_del/' + id; var that = this; $.post(url, function (a, b, c, d) { var getItem = function () { return function () { return that; }; } var current = getItem()(); var data = a; if (data.status == 200) { $(current).parent().parent().remove(); } }); });