开发者

Simple ajax and jquery ajax

开发者 https://www.devze.com 2023-03-23 03:23 出处:网络
I have a simple facebook app. Using some jquery ajax: $.ajax({ url: \'https://api.facebook.com/method/fql.query?query=\' +

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

精彩评论

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

关注公众号