最近搜索

如何 把数据 快速 组成 json 字符串。

浏览:376
管理员 2022-10-15 15:12



var json_str = "[";

json_str = json_str +"{";
json_str = json_str + '"file_path":"'+file_path+'",';
json_str = json_str + '"num":"'+num+'",';
json_str = json_str + '"biaozun":"'+biaozun+'",';
json_str = json_str + '"guige":"'+guige+'"';
json_str = json_str +"},";
row_num++;



json_str = json_str.substring(0,json_str.length-1);
json_str = json_str + ']';
console.log(json_str);



[

{"file_path":"/static/upload_image/sales/20221015/20221015231332.pdf","num":"11","biaozun":"11","guige":"1111"}
,
{"file_path":"/static/upload_image/sales/20221015/20221015231336.pdf","num":"23","biaozun":"23","guige":"23"}

]


联系站长

站长微信:xiaomao0055

站长QQ:14496453