fb.xd.resolverelation(...).fb'是 null 或不是一个对象 让我发疯

发布于 2025-01-07 01:02:26 字数 1614 浏览 3 评论 0原文

我已经尝试了几个小时才能让这个工作正常...在某些 IE 浏览器中请注意,并非所有浏览器在尝试连接 Facebook 登录时都会出现此错误。

fb.xd.resolverelation(...).fb' is null or not an object

当弹出框中的脚本在 Facebook 登录后返回我的网站时,会出现该错误。

我的连接代码如下所示

window.fbAsyncInit = function() {
          FB.init({
            appId      : '12345',
            status     : true, 
            cookie     : true,
            xfbml      : true,
            oauth      : true,
            channelUrl : '//site.com/pages/channel.php',
          });

      function updateButton(response) {
                     //button       =   document.getElementById('fb-auth');
                     loginHolder = document.getElementById('faceAccess');



                     if (response.authResponse) {
                         //user is already logged in and connected
                         loginHolder.style.display = "none";
                         FB.api('/me', function(info) {
                             login(response, info);
                         });

                     } 
                 }

      //window.onload=function(){
          // run once with current status and whenever the status changes
          FB.getLoginStatus(updateButton);
          FB.Event.subscribe('auth.statusChange', updateButton);
      //}

    };
    (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";
       d.getElementsByTagName('head')[0].appendChild(js);
     }(document));

I have ben trying for hours to get this working... In some IE browsers NOTE not all i get this error when trying to connect with Facebook login.

fb.xd.resolverelation(...).fb' is null or not an object

The error appears when the script inside the pop up box is going back to my site after login at Facebook.

My code looks like this for connecting

window.fbAsyncInit = function() {
          FB.init({
            appId      : '12345',
            status     : true, 
            cookie     : true,
            xfbml      : true,
            oauth      : true,
            channelUrl : '//site.com/pages/channel.php',
          });

      function updateButton(response) {
                     //button       =   document.getElementById('fb-auth');
                     loginHolder = document.getElementById('faceAccess');



                     if (response.authResponse) {
                         //user is already logged in and connected
                         loginHolder.style.display = "none";
                         FB.api('/me', function(info) {
                             login(response, info);
                         });

                     } 
                 }

      //window.onload=function(){
          // run once with current status and whenever the status changes
          FB.getLoginStatus(updateButton);
          FB.Event.subscribe('auth.statusChange', updateButton);
      //}

    };
    (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";
       d.getElementsByTagName('head')[0].appendChild(js);
     }(document));

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

败给现实 2025-01-14 01:02:26

尝试将 status : true, 更改为 status : false, 并查看是否能提供更好的结果。

Try changing status : true, to status : false, and see if that provides better results.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文