3

调试显示FB对象可用,以防Safari 7.0.6 FB.init触发但FB.getLoginStatus不可用。

目前代码看起来像这样

FB.init({
     appId: 'app_id',
     xfbml: true,
     status: true,
     cookie: true,
     version: 'v2.1'
 });


FB.getLoginStatus(function (response) {
     if (response.status == 'connected') {
         onLogin(response);
     } else {
         FB.login(function (response) {
             onLogin(response);
         }, {scope: 'public_profile'});
     }
 }, true);

控制台返回

Blocked a frame with origin 'http://static.ak.facebook.com' from accessing a frame with origin 'http://example.com'. The frame requesting access set 'document.domain' to 'facebook.com' but the frame being accessed did not. Both must be set 'document.domain' to the same value to allow access.

有什么猜测吗?

4

0 回答 0