function getUser()
{
FB.api('/me', function(response) {
console.log('Response is '+response);
alert('Your name is ' + response.first_name);
alert('Your last name is ' + response.last_name);
alert('Your Gender is ' + response.gender);
alert('Your status is '+response.username);
}
以下のような応答全体を印刷するにはどうすればよいですか?
{
"id": "blah blah",
"name": "blah blah",
"first_name": "blah blah",
"last_name": "blah blah",
"link": "https://www.facebook.com/blah blah",
"username": "blah blah",
"hometown": {
"id": "106442706060302",
"name": "Pune, Maharashtra"
},
"location": {
"id": "106377336067638",
"name": "Bangalore, India"
},
"bio": "╔══╗♫ ♪♫\n║██║\n║¨o•♫\n╚═|̲̅̅●̲̅̅|̅lιlllι ♫ I LoVe MuZiK!!\n\n█║▌│█│║▌║│█║▌│║\n® Copyright © 2012 ™\n█║▌│█│║▌║│█║▌│║\n\nReVoLt",
"gender": "male",
"relationship_status": "Single",
"timezone": 5.5,
"locale": "en_GB",
"verified": true,
"updated_time": "2012-06-15T05:33:31+0000",
"type": "user"
}
また、respose.nameによって、ユーザーの名前を取得しています。JSON配列であるため、パラメーターの場所で場所を取得するにはどうすればよいですか?