我有以下功能来删除一行。我想通过传入#search_result
.
function row_delete_ajax(event) {
event.preventDefault();
if (confirm(gettext('Are you sure you want to delete this row?'))) {
var url = $(this).attr("href") + "/";
$.post(url, function(result){
$('#search_result').empty();
$('#search_result').append(result);
});
}
};
这就是我最初绑定函数的方式,但是有点卡住了如何传递#search_result
给row_delete_ajax
$(document).ready(function (){
$('#search_result').find(".row_delete_ajax").click(row_delete_ajax);
}