function _functionservicecontentsave(projectid){
var datas=[];
$("[name='servercheck']").each(function(){
if(($(this).is(":checked")==true)){
datas.push($(this).val());
}
});
$.ajax({
url:requestContextPath()+"prj-budget/servicecontent/save",
dataType: "json",
traditional: true, //传送数组值
type: "POST",
data:{"datas":datas,
"projectid":projectid},
success: function (data) {
if(data.closeCurrent){
_functionlayeralert(data.message,1,functioniframerefresh);
}
}
});
var datas=[];
$("[name='servercheck']").each(function(){
if(($(this).is(":checked")==true)){
datas.push($(this).val());
}
});
$.ajax({
url:requestContextPath()+"prj-budget/servicecontent/save",
dataType: "json",
traditional: true, //传送数组值
type: "POST",
data:{"datas":datas,
"projectid":projectid},
success: function (data) {
if(data.closeCurrent){
_functionlayeralert(data.message,1,functioniframerefresh);
}
}
});
}
traditional
类型:Boolean
如果你想要用传统的方式来序列化数据,那么就设置为 true。所以如果要将数据作为参数传递时要设置为true。默认情况是false是不能传递数组。