ajax基础知识

function deleteData() {
var id_list = [];
$('#table_body').find(':checkbox').each(function () {
if ($(this).prop('checked')) {
id_list.push($(this).val());
}
});
$.ajax({
url: requestUrl,
type: 'DELETE',或post、get等
data: {id_list: id_list},提交form表单时,用data:$('#your_form_id').serialize(),
traditional: true,
success: function (response) {
if (response.status) {
SuccessHandleStatus(response.message);
} else {
alert(response.message);
}
$.Hide('#shade,#modal_delete');
refreshData();

},
error: function () {
$.Hide('#shade,#modal_delete');
alert('请求异常');
}
})
}
posted @ 2017-03-07 21:20  明天OoO你好  阅读(219)  评论(0编辑  收藏  举报