Problem using the facebook javascript sdk
I am using facebook javascript sdk to retrieve logged in users info.
I am able to retrieve user's name and Id with response.id and response.name. I want to see the complete json response I get from facebook.
I am new to json. I want to be able see the entire response. I appreciate any help.
function login(){
FB.api('/me', function(response) {
document.g开发者_如何转开发etElementById('userName').innerHTML = response.name;
});
}
Thanks for your help.
Log the value of response
on your console using:
console.log(response);
Here's the entire snippet:
function login() {
FB.api('/me', function(response) {
console.log(response);
});
}
This is what I see when I console log at my end:
first_name: "Anurag"
gender: "male"
id: "...."
last_name: "Mishra"
link: "...."
locale: "en_US"
name: "Anurag Mishra"
timezone: ...
updated_time: "..."
verified: ...
精彩评论