开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜