, 나는 다음과 같은 코드가 있습니다페이스 북 JS SDK - FB.getLoginStatus = 정의되지 않은
window.fbAsyncInit = function() {
FB.init({
appId:'139894666087975', cookie:true, status:true, xfbml:true
});
$('.login_fb').click(function(){
FB.login(function(response) {
if(response.session)
{
if (response.perms) {
window.location.reload();
}
}
},{perms:'email,user_birthday,user_hometown,user_location,publish_stream'});
});
FB.getLoginStatus(function(response) {
alert(response.authResponse);
if (response.authResponse) {
alert(response.authResponse);
} else {
$.blockUI({
message: $('#fblogin'),
css: {
top: '9%',
left: ($(window).width() - 700) /2 + 'px',
width: '700px',
cursor: 'hand',
border: '10px solid #ccc',
}
});
}
});
};
response.AuthResponse를 들어 getLoginStatus는 'undefined'이지만 실제로이 앱에 설정된 권한으로 로그인되어 있습니다.
왜 계속 정의되지 않은 것으로 표시 될지 궁금하십니까? 다시 로그인을 시도하면 페이스 북 상자가 닫히고 (이미 로그인되어 있기 때문에) 'undefined'를 다시 표시하여 페이지를 새로 고칩니다.
도움 주셔서 감사합니다.
나는 결코 이것을 수정으로 생각하지 않을 것이다! 와우, 스티브 감사합니다! – iUsable