js-json

1
2
3
4
5
6
7
8
9
var datas=[];

var data = {};
data["id"] = 1;
data["name"] = "test" + 1;
data["age"] = 1 * 2;
datas.push(data);
var jsonString = JSON.stringify(datas); //[{"id":1,"name":"test1","age":2}]
alert(jsonString);
坚持原创技术分享,您的支持将鼓励我继续创作!