开发者

Facebook FQL Question

开发者 https://www.devze.com 2022-12-28 16:31 出处:网络
I\'m trying to use the Facebook Javascript API to run FQL queries, and it works fine if I try and get users by username or uid, but doesn\'t work when I\'m searching by name.

I'm trying to use the Facebook Javascript API to run FQL queries, and it works fine if I try and get users by username or uid, but doesn't work when I'm searching by name.

function get_username()
{
    var name = prompt("Enter name: ")        
      FB.api(
      {
        method: 'fql.query',
        query: 'SELECT username FRO开发者_高级运维M user WHERE name in "'+name+'"'
      },
      function(response) {
          var x = response[0].username
        alert('Username is ' + x);
      }
    );
}

I realize that this will probably return multiple users, but I can't figure out how to tell if it's returning multiple users or no users at all, it seems to freeze after trying to get response[0].username.

I'm probably making a beginner mistake but any ideas?


Check this out: http://developers.facebook.com/docs/reference/fql/user

I don't see a username field. I think that's the issue.

HTH.

0

精彩评论

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

关注公众号