2012-02-16 79 views
0

我有幾個小時試圖讓這個工作...在一些IE瀏覽器注意不是所有我得到這個錯誤時試圖與Facebook登錄連接。fb.xd.resolverelation(...)。fb'爲null或不是一個對象讓我瘋狂

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)); 

回答

0

嘗試改變status : true,status : false,,看看是否能提供更好的結果。

+0

感謝您的評論!但沒有做到這一點:(但我從來沒有遇到任何問題,我似乎無法理解這個問題... – Tobias 2012-02-16 20:32:54

+0

接下來嘗試強制它只使用HTTPS。看看IE的一個版本是否更喜歡它。 – DMCS 2012-02-16 20:43:52

+0

再次感謝您的幫助,不幸的是,這並沒有做到:(它可能與跨域有關?它是如此奇怪,它發生在一些瀏覽器 – Tobias 2012-02-16 23:11:57