码迷,mamicode.com
首页 > 其他好文 > 详细

【技巧】处理提交数据的技巧

时间:2017-08-19 12:40:33      阅读:115      评论:0      收藏:0      [点我收藏+]

标签:sources   ids   add   push   get   处理   成功   instance   success   

function addUserRole() {
var instance = $(‘#resourcesTree‘).jstree(true);
var select = instance.get_checked (true);
var ids = [];
for (var i = 0; i < select.length; i++) {
ids.push(‘{"id":"‘ + select[i].id + ‘"}‘);
}
debugger;
$.ajax({
type : "post", //提交方式
url : "${ctx}/role/addRoleResources/" + ${roleId},//路径
//dataType : "json",
contentType : "application/json",
data : ‘[‘ + ids + ‘]‘,
success : function(result) {//返回数据根据结果进行相应的处理
parent.parent.layer.alert(‘保存成功!‘, {
icon : 6
});
}
});
}

【技巧】处理提交数据的技巧

标签:sources   ids   add   push   get   处理   成功   instance   success   

原文地址:http://www.cnblogs.com/CESC4/p/7395757.html

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