2011-06-15 38 views
1

我使用fbAsyncInit方法,生活在粉絲頁面標籤的iframe應用的FB.login生產閃存錯誤

<script> 
    window.fbAsyncInit = function() { 
     console.log('fb init'); 
    FB.init({ 
     appId : 12345, 
     status : true, // check login status 
     cookie : true, // enable cookies to allow the server to access the session 
     xfbml : true // parse XFBML 
    }); 
    }; 

    (function() { 
    var e = document.createElement('script'); 
    e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; 
    e.async = true; 
    document.getElementById('fb-root').appendChild(e); 
    }()); 
</script> 

當我調用寄存器功能檢查權限(這種情況發生時,用戶在頁面加載後點擊按鈕)

register = function(){ 
console.log('starting login'); 
FB.login(function(response) { 
    if (response.session) { 
      console.log(response.session); 
     } else {     
      console.log('Did not authorize'); 
     } 
}, {perms:'email,publish_stream'}); 

};

Facebook的加載彈出窗口:http://static.ak.fbcdn.net/connect/xd_proxy.php?version=3#cb= {會話字符串變量和這裏其他垃圾}

僅在IE產生閃光錯誤:

Error #2044: Unhandled StatusEvent:. level=error, code= 

我的網站中有

無頻閃

打繼續/解僱有時會凍結IE導致我結束進程,其他時間彈出消失

回答

1

我們找到了解決方案n爲Flash問題。請更新FB.init

FB.init({ 
     appId : 12345, 
     status : true, // check login status 
     cookie : true, // enable cookies to allow the server to access the session 
     xfbml : true, // parse XFBML 
     channelURL : 'http://www.YOURDOMAIN.com/channel.html' 
    }); 

在您的域根文件夾中創建channel.html,把只有這個代碼是:

<script src="https://connect.facebook.net/en_US/all.js"></script> 

現在在Facebook上的Flash正常工作。

0

使用Flash/FaceBook API時,Flash 10.2會出現以下錯誤。 SecurityError:錯誤#2000:沒有活動的安全上下文。

Flash 10.3得到了 錯誤#2044:未處理的StatusEvent :.級別=錯誤,代碼=

我從Flash應用程序調用Facebook.login()。登錄成功,但是這個錯誤似乎破壞了這個過程。這個問題隻影響IE 8,沒有其他瀏覽器。 我試過了channelUrl,但在另一個域中,因爲我沒有訪問flash文件的位置。我正在使用Charles來映射本地。這會工作嗎?

在此之外,我迷路了。我不確定錯誤是由我的SWF或Facebook的代理SWF觸發的。太令人沮喪了。這是幾個月前的工作。

+0

您是否添加了上述答案中指定的頻道網址? – chrisan 2011-06-21 09:57:11

+0

今天早上我測試了,我可以確認....這個修補程序。只要確保你的channelUrl位於相同的域.....問題...如果我們需要區域化all.js怎麼辦?包含在頁面上的那個是否超過了這個? – leedium 2011-06-21 13:32:56

0

上面提供的解決方案對我無效。但這絲毫我在計算器上的另一個話題發現(感謝肖恩·金賽):

看到這個錯誤報告: http://bugs.developers.facebook.net/show_bug.cgi?id=15596 IE8,getLoginStatus當使用閃光燈XD無法完成 - 這聽起來像它可能是你是什麼經歷。

在這種情況下,請確保您的FB-根格被設置爲visibility:hidden的顯示:無,因爲這將導致XD閃存不渲染

(我也添加了channelURL)