0
javascript sdkを使用してFacebookにログインし、ユーザーのメールIDと一般情報を取得する必要があります。フェイスブックからメールやその他の詳細を取得するjavascript sdk
ここはmyコードです。私は間違っているつもりだところを教えてください:
<script>
window.fbAsyncInit = function() {
FB.init({ appId: 'your_app_id', status: true, cookie: true,
xfbml: true
});
FB.getLoginStatus(function (response) {
if (response.session) {
greet();
}
});
};
(function() {
var e = document.createElement('script');
e.type = 'text/javascript';
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
function greet() {
FB.api('/me', function (response) {
alert('Welcome, ' + response.name + "!");
alert('Your email id is : '+ response.email);
}
);
}
</script>