遍历json集合

[{"list":[{"count":0,"createTime":"2008-01-2500:00:00","createUserDept":"","createUse... [{"list":[{"count":0,"createTime":"2008-01-25 00:00:00","createUserDept":"","createUserDeptId":"","createUserId":"","createUserName":"","deleteFlag":"0","introduction":"","month":"","pagerSize":0,"periodicalId":"","periodicalName":"admin","periodicalType":"","publishDate":null,"status":"0","updateUserDept":"","updateUserDeptId":"","updateUserId":"","updateUserName":"","year":""},{"count":0,"createTime":"2008-01-25 00:00:00","createUserDept":"","createUserDeptId":"","createUserId":"","createUserName":"","deleteFlag":"0","introduction":"","month":"","pagerSize":0,"periodicalId":"","periodicalName":"admin","periodicalType":"","publishDate":null,"status":"0","updateUserDept":"","updateUserDeptId":"","updateUserId":"","updateUserName":"","year":""}],"pageString":""}]

可追加分,如何遍历上面json对象
展开
 我来答
sdevil507
2012-07-09 · 超过13用户采纳过TA的回答
知道答主
回答量:51
采纳率:0%
帮助的人:29.5万
展开全部
var a=[{"list":[{"count":0,"createTime":"2008-01-25 00:00:00","createUserDept":"","createUserDeptId":"","createUserId":"","createUserName":"","deleteFlag":"0","introduction":"","month":"","pagerSize":0,"periodicalId":"","periodicalName":"admin","periodicalType":"","publishDate":null,"status":"0","updateUserDept":"","updateUserDeptId":"","updateUserId":"","updateUserName":"","year":""},{"count":0,"createTime":"2008-01-25 00:00:00","createUserDept":"","createUserDeptId":"","createUserId":"","createUserName":"","deleteFlag":"0","introduction":"","month":"","pagerSize":0,"periodicalId":"","periodicalName":"admin","periodicalType":"","publishDate":null,"status":"0","updateUserDept":"","updateUserDeptId":"","updateUserId":"","updateUserName":"","year":""}],"pageString":""}]
var list=a[0].list;
for(i=0;i<list.length;i++){
alert(list[i].count);
alert(list[i].createTime);
............
............
............
}
当数组处理,只是成员为对象
追问
你好:那我从后台返回到页面的值还可以是json对象吗
追答
可以的,你在转到前台过程中  进行stringbuff拼接,到前台 JS遍历一样;
过程只是字符串的传递;
ak47zhangrui
2012-07-09 · TA获得超过128个赞
知道答主
回答量:67
采纳率:0%
帮助的人:24.7万
展开全部
list中包含一个数组,在那对中括号里每对大括号包裹的就是数组中的一个元素,楼主可以将这个json字符串理解为有两个节点,第一个是list(内容是数组),第二个是pageString
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
huoyeshenhua
2012-07-09 · TA获得超过5220个赞
知道小有建树答主
回答量:892
采纳率:85%
帮助的人:482万
展开全部
var json={
"list":[
{"count":0,"createTime":"2008-01-25 00:00:00","createUserDept":"","createUserDeptId":""},
{"count":0,"createTime":"2008-01-25 00:00:00","createUserDept":"","createUserDeptId":""}
],
"pageString":""
};
//traverse
for (var key in json)
{
for (var option in json[key])
{
document.write(json[key][i].count);
}
}
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
匿名用户
2012-07-09
展开全部
。。。。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
收起 更多回答(2)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式