我正在尝试将 FQL 查询添加到 Sociogram 示例: http ://coenraets.org/blog/2013/02/sociogram-a-sample-application-exploring-the-facebook-sdk-and-the-graph-api/
我正在接收数据但收到错误消息:“ReferenceError:未定义数据”
它适用于 Graph API 调用:
try {
FB.api("/" + id + "/events?limit=20", function (response) {
if (response.error) {
self.showErrorPage();
} else {
$('#content').append(new fb.views.Events({model: new Backbone.Model(response)}).el);
}
});
},
但不是 FQL 调用:
try {
FB.api({
method: 'fql.query',
query: 'SELECT name, eid FROM event WHERE eid IN (SELECT eid FROM event_member WHERE uid = me())'
}, function (response) {
if (response.error) {
self.showErrorPage();
} else {
$('#content').append(new fb.views.Events({model: new Backbone.Model(response)}).el);
}
});
},
Graph API 调用(有效)会产生一个数据 [],而 FQL 看起来像是充满了对象,而不是在数据 [] 容器中。我很确定这是区别,但我不知道如何解决它。