How to access events created by user in Facebook API by using Javascript? -


i know basic of javascript , second call facebook api , having problem. need read list of user's events. here code inside function:

fb.api('/me/events', function(response) {         console.log("event id: " + response.data[0].id);       }); 

output is:

uncaught typeerror: cannot read property 'id' of undefined 

i tried outout this:

fb.api('/me/events', function(response) {         console.log("event id: " + response.data[0]);       });  event id: undefined 

i have created couple of events , join couple of events. , used this:

fb.api('/me', function(response) {        var str="<b>name</b> : "+response.name+"<br>";           str +="<b>link: </b>"+response.link+"<br>"; 

and works fine. there shouldn't problem user login. appreciate if can me this.

you need ask user user_events permission, before can access events.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -