json文件解析。。。。。。。

[
{"id":"100","age":"1","name":"张三"},
{"id":"101","age":"2","name":"李四"},
{"id":"102","age":"3","name":"王五"},
{"id":"4","age":"14","name":"admin"},
{"id":"5","age":"14","name":"欠额为"}
]

2个回答

用fastjson转换成jsonarray解析

什么语言也不说,服了you。。对应的服务器端语言都可以建立实体类后反序列化为对应的类实例,自己百度下相关资料,下面是js的

 <script>
    var d = [
{ "id": "100", "age": "1", "name": "张三" },
{ "id": "101", "age": "2", "name": "李四" },
{ "id": "102", "age": "3", "name": "王五" },
{ "id": "4", "age": "14", "name": "admin" },
{ "id": "5", "age": "14", "name": "欠额为" }
];
for (var i = 0; i < d.length; i++)
    document.write(d[i].id + "|" + d[i].age + "|" + d[i].name + "<br>");
</script>
showbo
支付宝加好友偷能量挖,胡杨等着我的招呼 回复wu_Ella: http://blog.sina.com.cn/s/blog_7ffb8dd501013qas.html
5 年多之前 回复
wu_Ella
wu_Ella 好吧。我错了,用fastjson,谢谢。。
5 年多之前 回复
立即提问
相关内容推荐