Simple ajax and jquery ajax
I have a simple facebook app.
Using some jquery ajax
:
$.ajax({
url: 'https://api.facebook.com/method/fql.query?query=' +
encodeURI(query) + '&access_token=' + accessToken +'&format=json',
dataT开发者_StackOverflow社区ype: 'jsonp',
success: function(response) {
console.log(response);
}
});
result: `[Object { uid1="100002251534328", uid2="708404079"}]`
Why can't I type response.uid1
to get uid1
?
It seems that response is array containing objects. Instead of response.uid1
try to use response.get(0).uid1
精彩评论