I need to get a facebook user uid , gender, photo and other profile data with Javascript.
I remember there was a method to get an user object with .id, .gender, .pho
The function FB.getSession() used in the accepted answer to this question in 2011 is now (2012) deprecated and removed from the Facebook JS SDK.
You can still discover the user's Facebook ID with the getLoginStatus() method like this:
FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
alert ("Your UID is " + response.authResponse.userID);
}
});
Note: you still have to init the Facebook API and put the fb-root element in your HTML, like Aleadam explained in the accepted answer.