//删除当前问题
$('#question_list').on('click', '.delete_question', function (ev) {
if ($(this).parent().attr('ql') === undefined){
$(this).parent().remove();
return;
}
if($(this).parent().attr('ql') !== undefined){
$.ajax({
url: '/delete_question/?id=' + $(this).parent().attr('ql'),
type: 'get',
success: function (data) {
if (data['isDeleted']) {
//问题数据被删
$(ev.target).parent().parent().remove()
}
}
})
}
});
Html之在事件委派中发送Ajax请求获取当前元素并删除
最新推荐文章于 2020-06-20 18:41:30 发布