I am using FQL to fetch data from Facebook graph API.When i give a get request via jquery to Facebook, I get the response data in the call back function but,when I tried to process it,i found that the response is treated as a string(I am not able to iterate through it considering it as dictionary) but firebug log shows the following json data.
console.log(response);
RESULT:
{
"data": {
"fql_search_result": [{
"aid": "xxxxx",
}, {
"aid": "xxxxx",
}, ]
}
}
I got error saying response has no attribute data, when i did this
console.log(response.data)
Why is the data treated as string and not as dictionary?
Did you give the dataType as ‘json’ in the request that you made via jQuery?
Alternatively you can try using the jQuery short hand function for AJAX GET Requests which has dataType as ‘json’ by default.