开发者社区> 问答> 正文

新人贴,有关于循环遍历json格式的问题,求罩啊各位老大!

{"curPage":"1","totalPage":"1","title":[{"id":22,"title":"《蘑菇战争》通关技巧防守篇","userid":3,"typeid":5,"pubtime":1461686400000,"readtimes":0,"articlePic":null,"orderNum":22},{"id":23,"title":"《蘑菇战争》通关技巧进攻篇","userid":2,"typeid":5,"pubtime":1456243200000,"readtimes":0,"articlePic":null,"orderNum":23},{"id":24,"title":"《蘑菇战争》游戏攻略 新手必看","userid":3,"typeid":5,"pubtime":1434988800000,"readtimes":0,"articlePic":null,"orderNum":24}]}

我想在js脚本里面循环输出这个json格式,改怎样循环呀 我用$.each循环试了下,能单独循环 {"title":[{"id":22,"title":"《蘑菇战争》通关技巧防守篇","userid":3,"typeid":5,"pubtime":1461686400000,"readtimes":0,"articlePic":null,"orderNum":22},{"id":23,"title":"《蘑菇战争》通关技巧进攻篇","userid":2,"typeid":5,"pubtime":1456243200000,"readtimes":0,"articlePic":null,"orderNum":23},{"id":24,"title":"《蘑菇战争》游戏攻略 新手必看","userid":3,"typeid":5,"pubtime":1434988800000,"readtimes":0,"articlePic":null,"orderNum":24}]} 但是加了"curPage":"1","totalPage":"1" 循环就报错了。 求解啊! 先谢谢各位了

展开
收起
杨冬芳 2016-07-06 19:34:25 2041 0
1 条回答
写回答
取消 提交回答
  • 没有代码的求解都是耍流氓,哈哈。
    应该是取的Json节点有问题吧。

    2019-07-17 19:52:27
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载