我非常了解 javascript,这是我对 Facebook API 的第二次调用,我遇到了问题。我需要阅读用户事件列表。这是我在函数中的代码:
FB.api('/me/events', function(response) {
console.log("event id: " + response.data[0].id);
});
输出是:
Uncaught TypeError: Cannot read property 'id' of undefined
我试图摆脱这个:
FB.api('/me/events', function(response) {
console.log("event id: " + response.data[0]);
});
event id: undefined
我已经创建了几个活动并加入了几个活动。我也使用了这个:
FB.api('/me', function(response) {
var str="<b>Name</b> : "+response.name+"<br>";
str +="<b>Link: </b>"+response.link+"<br>";
它工作正常。所以用户登录应该没有问题。如果有人可以帮助我,我将不胜感激。