views:

39

answers:

1

Hi,

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.getElementById('userName').innerHTML = response.name;
    });
}

Thanks for your help.

A: 

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: ...
Anurag