I have a Json object return from my FB.api but I have difficulty in fetching the data components in it, basically I just need the ‘name’ and ‘accesstoken’ every individual from ‘data’, tried several ways from a few examples but still can’t get it. Can anybody help. Thanks.
if (response.authResponse) {
FB.api('/me/accounts', function (result) {
console.log(result);
});
}
I can see the data from firebug like this from the log result:
data
[Object { name=
"Test Company"
, access_token=
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
, category=
"Travel/leisure"
, more...}, Object { name=
"Some Page"
, access_token=
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
, category=
"Computers/technology"
, more...}, Object { name=
"Something"
, access_token=
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
, category=
"App page"
, more...}, 40 more...]
paging
Object { next=
"https://graph.facebook....fter_id=68468454846654"
}
Did you try iterating over data?