2012-01-04 109 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'}); 

}); 

回答