I use json.stringify() to get the data when submitting the form. Return as follows.
{"domains":[{"value":"vvvvvvvvv"}],"cona":"heeheeheeheeheeheeheexia","conb":"minutes, points, points, points v"}
Can it be converted into a normal string format? I want to convert it into the following format. I have tried many methods without success.
淡淡烟草味2017-05-18 11:00:08
json is essentially a string, but it is a "formatted" string.
If you want to convert it to other strings, you need to write your own rules, such as:
var objFormat = {toString:function(){return this.domains.map(function(item){
return item.value;
}).join(',')+','+this.cona+','+this.conb}};
var jsonStr = '{"domains":[{"value":"vvvvvvvvv"}],"cona":"嘻嘻嘻嘻嘻嘻下","conb":"分分分分分分v"}';
var parsedString = objFormat.toString.call(JSON.parse(jsonStr));
// 得到 vvvvvvvvv,嘻嘻嘻嘻嘻嘻下,分分分分分分v