javascript - how to correct parse json with JS -
this question has answer here:
- parse json in javascript? [duplicate] 16 answers
i write web app witch generate json
[ "rows", { "url":"img\/video_default.gif", "title":"no title :-(", "color":2, "time":"19 apr. 2015", "viewed":"4" }, "rows", { "url":"android\/uploads_i\/xaymrun2bbknt.gif", "title":"no title :-(", "color":3, "time":"19 apr. 2015", "viewed":"1" }, "rows", { "url":"android\/uploads_i\/ulzouoe48lyvl.gif", "title":"gff", "color":4, "time":"19 apr. 2015", "viewed":"335" }, "rows", { "url":"android\/uploads_i\/4uiaiqqhpn14k.gif", "title":"no title :-(", "color":5, "time":"19 apr. 2015", "viewed":"2" }, "rows", { "url":"img\/video_default.gif", "title":"no title :-(", "color":1, "time":"19 apr. 2015", "viewed":"1" }, "rows", { "url":"img\/video_default.gif", "title":"no title :-(", "color":2, "time":"18 apr. 2015", "viewed":"1" }, "rows", { "url":"android\/uploads_i\/t7k2btku553zr.gif", "title":"ggdd", "color":3, "time":"16 apr. 2015", "viewed":"7" }, "rows", { "url":"img\/video_default.gif", "title":"no title :-(", "color":4, "time":"16 apr. 2015", "viewed":"7" }, "rows", { "url":"android\/uploads_i\/hv0wxd2tcakcu.gif", "title":"test", "color":5, "time":"16 apr. 2015", "viewed":"8" }, "rows", { "url":"android\/uploads_i\/vgp7xhimqayyl.gif", "title":"ggc", "color":1, "time":"16 apr. 2015", "viewed":"7" }, "rows", { "url":"img\/video_default.gif", "title":"no title :-(", "color":2, "time":"16 apr. 2015", "viewed":"7" }, "rows", { "url":"android\/uploads_i\/qqpxyfv5wp5c1.gif", "title":"", "color":3, "time":"16 apr. 2015", "viewed":"8" }, "rows", { "url":"img\/video_default.gif", "title":"edfft", "color":4, "time":"16 apr. 2015", "viewed":"7" }, "rows", { "url":"img\/video_default.gif", "title":"no title :-(", "color":5, "time":"16 apr. 2015", "viewed":"25" }, "rows", { "url":"img\/video_default.gif", "title":"no title :-(", "color":1, "time":"16 apr. 2015", "viewed":"7" }, "rows", { "url":"img\/video_default.gif", "title":"no title :-(", "color":2, "time":"16 apr. 2015", "viewed":"7" }, "rows", { "url":"img\/video_default.gif", "title":"no title :-(", "color":3, "time":"16 apr. 2015", "viewed":"7" }, "rows", { "url":"img\/video_default.gif", "title":"gfxdrf", "color":4, "time":"16 apr. 2015", "viewed":"7" }, "rows", { "url":"img\/video_default.gif", "title":"no title :-(", "color":5, "time":"16 apr. 2015", "viewed":"7" }, "rows", { "url":"android\/uploads_i\/punrwiakcfmg4.gif", "title":"\u043f\u0430", "color":1, "time":"16 apr. 2015", "viewed":"11" }, "rows", { "url":"img\/video_default.gif", "title":"no title :-(", "color":2, "time":"16 apr. 2015", "viewed":"7" }, "rows", { "url":"android\/uploads_i\/d3rusy5doo8b3.gif", "title":"hgdd", "color":3, "time":"16 apr. 2015", "viewed":"7" }, "rows", { "url":"img\/video_default.gif", "title":"no title :-(", "color":4, "time":"16 apr. 2015", "viewed":"7" }, "rows", { "url":"android\/uploads_i\/bglqjguuaimup.gif", "title":"gdd", "color":5, "time":"16 apr. 2015", "viewed":"7" }, "rows", { "url":"android\/uploads_i\/udkwcvrjeymb6.gif", "title":"title", "color":1, "time":"16 apr. 2015", "viewed":"7" } ]
please me, how can parse javascript access object item, thank you
use json.parse.
var result = json.parse(data);
to title example, use
var title = result[1]['title'];
Comments
Post a Comment