首页 > Web开发 > 详细

ajax基础知识

时间:2017-03-07 22:49:33      阅读:261      评论:0      收藏:0      [点我收藏+]
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(‘请求异常‘);
}
})
}

ajax基础知识

原文:http://www.cnblogs.com/wt11/p/6516902.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!