2012-01-27 71 views
0

我正在使用Facebook的JavaScript SDK用我的網站上的Facebook按鈕註冊。我已經使用這個腳本:已更新facebook的FB.init登錄錯誤

<div id="fb-root"></div> 
    <img onclick="fb_login();" src="public/images/facebook_signup.jpg" id="fb-login" style="vertical-align: middle; margin-top: -1px; cursor: pointer;" alt="Sign up with facebook"> 
    <script type="text/javascript"> 
     FB.init({appId: '423901a20718dce67e82992eeb6f41bf', status: true, cookie: true, xfbml: true, oauth: true}); 
     function fb_login() { 
      FB.login(function(response) { 
       if(response.authResponse) { 
        console.log('Welcome! Fetching your information.... '); 
       } 
      },{scope:'email,user_birthday,offline_access,publish_stream,read_friendlists'}); 
     } 
     function fb_logout() { 
      FB.logout(function(response) { 
       if(response.authResponse) { 
       } 
      }); 
     } 
     FB.Event.subscribe('auth.sessionChange', function(response) { 
      if (response.authResponse) { 
       // A user has logged in, and a new cookie has been saved 
      } else { 
       // The user has logged out, and the cookie has been cleared 
      } 
     }); 
    </script> 

但是,當點擊按鈕後,它提供了一個Facebook的錯誤「出現錯誤,請稍後再試。」

任何幫助將不勝感激。

回答