facebook - How to access the following json code using jsp? -
{ "likes": { "data": [{ "id": "122032077982945"//id }, { "id": "307083702751174"//id }, { "id": "197394889304" }] } } i want access facebook data. want print of user in webpage.how access following json code using jsp? how should this?
if doing ajax call jsp page server side , receive data, can parse them using javascript , jquery:
var likesdata = jquery.parsejson('{"likes": {"data": [{"id": "122032077982945"}, {"id": "307083702751174"}, {"id": "197394889304"}]}}').likes.data; (var idx in likesdata) { console.log("likeid: " + likesdata[idx].id); } you'll get:
likeid: 122032077982945 likeid: 307083702751174 likeid: 197394889304
Comments
Post a Comment