What is the code to parse JSON?

I have the following JSON text that I need to parse to get pageName, pagePic, post_id, etc.

What is the required code?

{

"pageInfo": { "pageName": "abc", "pagePic": "http://example.com/content.jpg" } "posts": [ { "post_id": "123456789012_123456789012", "actor_id": "1234567890", "picOfPersonWhoPosted": "http://example.com/photo.jpg", "nameOfPersonWhoPosted": "Jane Doe", "message": "Sounds cool. Can't wait to see it!", "likesCount": "2", "comments": [], "timeOfPost": "1234567890" } ] }

enter code here


var jsonString = "pageInfo": { "pageName": "abc", "pagePic": "http://example.com/content.jpg" } "posts": [ { "post_id": "123456789012_123456789012", "actor_id": "1234567890", "picOfPersonWhoPosted": "http://example.com/photo.jpg", "nameOfPersonWhoPosted": "Jane Doe", "message": "Sounds cool. Can't wait to see it!", "likesCount": "2", "comments": [], "timeOfPost": "1234567890" } ] }
JSON.parse(jsonString)

这里是代码

链接地址: http://www.djcxy.com/p/29960.html

上一篇: 从李和ul删除黑点

下一篇: 什么是解析JSON的代码?