2012-01-04 134 views
0

我使用Facebook登錄時沒有問題。但神祕的是,下一個錯誤開始出現在螢幕控制檯中,現在我無法登錄。我們可以通過下面的例子來說明如何使用FB.provide('',{getLoginStatus:function ... signed_request,code'}); return a;}}});}}Facebook登錄錯誤Javascript

我正在使用Javascript SDK。

<div id='fb-root'></div> 
    <script> 
    //<![CDATA[ 
     window.fbAsyncInit = function() { 
     FB.init({ 
     appId  : '205160466168923', // App ID 
     status  : true, // check login status 
     cookie  : true, // enable cookies to allow the server to access the session 
     oauth  : true, // enable OAuth 2.0 
     xfbml  : true // parse XFBML 
     }); 
     //channelUrl : '//www.clasesd.com/channel.html', // Channel File 

     // Additional initialization code here 
     }; 

     // Load the SDK Asynchronously 
     (function(d){ 
     var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;} 
     js = d.createElement('script'); js.id = id; js.async = true; 
     js.src = "//connect.facebook.net/en_US/all.js#**oauth=1**&appId=205160466168923&xfbml=1"; 
     d.getElementsByTagName('head')[0].appendChild(js); 
     }(document)); 
    //]]> 
    </script> 

這是我用來觸發登錄

FB.login(function(response) { 
if (response.authResponse) { 
    FB.api('/me', function(response) { 
    console.log('Good to see you, ' + response.name + '.'); 
    window.location = redirect_url; 
    }); 
} else { 
    console.log('User cancelled login or did not fully authorize.'); 
} 
}, {scope: 'email, offline_access, publish_stream, user_events'}); 

}); 

回答