var DTO = [];
$.each(data.Foobars, function(i, val){
DTO.push(val);
});
//example of a stringified object in the array:
// var val = {"a":"1","b":"2","c":"3"};
var jsonString = JSON.stringify(DTO);
如果数组中有一个对象,“jsonString”将如下所示:
[{"a":"1","b":"2","c":"3"}]
不止一个:
[[{"a":"1","b":"2","c":"3"}, {"a":"1","b":"2","c":"3"}]]
导致出现双括号,这导致我在服务器端出现一些问题。
我怎样才能摆脱双括号?谢谢