json串拼接模版

              var jsonarr = new Array;;

       jsonstr = '{' +

'"objuid":' + '"' + abp.common.json2string($.trim(objuid)) + '",' +

'"scx_uid":' + '"' + abp.common.json2string($.trim(scx_uid)) + '",' +

'"ph":' + '"' + abp.common.json2string($.trim(ph)) + '",' +

'"pm":' + '"' + abp.common.json2string($.trim(pm)) + '",' +

'"gg":' + '"' + abp.common.json2string($.trim(gg)) + '",' +

'"zt":' + '' + abp.common.json2string($.trim(JSON.stringify(gx))) + ',' +

'"ts":' + '' + abp.common.json2string($.trim(JSON.stringify(gx))) + ',' +

"}";

jsonarr.push(jsonstr);

var jsparams = new abp.common.JSParams();

jsparams.push("jsons", "[" + jsonarr.join(",") + "]");

var url = "/"+globalURL+"/servicecontroller?";

$.ajax({

type: "post",

url: url,

data:"userDefineClass=com.anolesoft.mes.stk.action.TouLiaoAction&callType=ao"+"&"+jsparams.paramsToString(),

dataType:"text",

success: function(data){

if($.trim(data) == "success"){

alert("保存成功!");

}else if($.trim(data) == "error"){

alert("保存失败!");

}else{

alert($.trim(data));

}

},error:function(data){

alert("发生错误.");

//$("#button_4028818251dc9f220151dcb3ca8c017b").closeOpenPane();

}

});

上一篇:Spark Core知识点复习-1


下一篇:JVM垃圾回收补充知识点