码迷,mamicode.com
首页 > Web开发 > 详细

ajax基础知识

时间:2017-03-07 22:49:33      阅读:209      评论:0      收藏:0      [点我收藏+]

标签:string   function   ons   ajax   提交   push   handle   ring   sha   

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基础知识

标签:string   function   ons   ajax   提交   push   handle   ring   sha   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!