Tengo el siguiente texto JSON que necesito analizar para obtener pageName, pagePic, post_id, etc.
¿Cuál es el código requerido?
{
"información de la página": { "pageName": "abc", "pagePic": "http://example.com/content.jpg" } "publicaciones": [ { "post_id": "123456789012_123456789012", "actor_id": "1234567890", "picOfPersonWhoPosted": "http://example.com/photo.jpg", "nameOfPersonWhoPosted": "Jane Doe", "message": "Suena bien. ¡No puedo esperar para verlo!", "likesCount": "2", "comentarios": [], "timeOfPost": "1234567890" } ] }
Ingresa el código aquí
Respuestas
1 para la respuesta № 1var 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)
aquí está el código