var jsonlist = {};
for(var i = 0 ; i<2;i++){
// 谢谢各位
}
// JSON2
alert(JSON.stringify(jsonlist));
期望结果
[{"fon":"1","fnum":"1"},
{"fon":"2","fnum":"2"}
]
------解决方案--------------------
- JScript code
var jsonlist = []; for(var i = 0 ; i<2;i++) jsonlist.push({"fon": (i + 1).toString(), "fnum": (i + 1).toString()});