gpt4 book ai didi

facebook - 如何使用 JS SDK 进行 FQL 查询?

转载 作者:行者123 更新时间:2023-12-02 08:48:20 25 4
gpt4 key购买 nike

这是我的代码,但不起作用:

FB.api(
{
method: 'fql.query',
query: 'SELECT uid, first_name, last_name FROM user WHERE uid=100002306311953'
},
function(data) {
alert(data.uid);
}
);
});

我在警报中收到“未定义”。为什么?

最佳答案

欢迎来到 SO!

你可以通过传递fql.query方法和查询来使用FB.api函数,

返回当前用户名称的简单查询:

FB.api({
method: 'fql.query',
query: 'SELECT uid, name FROM user WHERE uid = me()'
}, function(data) {
console.log(data);
var res = data[0].name;
alert(res);
}
);

FB 文档:https://developers.facebook.com/docs/reference/fql/

关于facebook - 如何使用 JS SDK 进行 FQL 查询?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10648993/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com