怎么用Thinkphp+jquery实现ajax的提交,接收处理和返回
展开全部
$.ajax({
type: "POST",
url: "/index.php/Home/Variable/add_variables.html",
data: {"set_id":st_id,"t_id":t_id,"varList":varList,"source_title":source_title},
dataType: "JSON",
success: function(ret){
console.log(ret);
addVarFlag=true;
if(ret.code==200){
for(var i=0;i<checkBoxs.length;i++){
if(!$(checkBoxs[i]).hasClass("checkAll")){
var cbox=$(checkBoxs[i]).parents("tr").remove();
}
}
fillColVarList(ret.data)
}else{
AlertBox("添加失败!");
}
}
});
type: "POST",
url: "/index.php/Home/Variable/add_variables.html",
data: {"set_id":st_id,"t_id":t_id,"varList":varList,"source_title":source_title},
dataType: "JSON",
success: function(ret){
console.log(ret);
addVarFlag=true;
if(ret.code==200){
for(var i=0;i<checkBoxs.length;i++){
if(!$(checkBoxs[i]).hasClass("checkAll")){
var cbox=$(checkBoxs[i]).parents("tr").remove();
}
}
fillColVarList(ret.data)
}else{
AlertBox("添加失败!");
}
}
});
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询