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
Update: I added a little more detail to the answer:
First, you need to call FB.init and add your app id:
FB.init(
{
appId : APP_ID,
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
Next, check if there is a session open (i.e., the user is logged in)
if(FB.getSession() != null) {
And query the details by:
FB.api('/me', function(response)
{
alert ("Welcome " + response.name + ": Your UID is " + response.id);
});
}
You will also need to add to the of your page, and load
The user profile picure can be accessed as http:/graph.facebook.com/USERID/picture/
Check the Graph API reference here: http://developers.facebook.com/docs/reference/api/user/
and the FB SDK reference here: http://developers.facebook.com/docs/reference/javascript/