2011-10-01 114 views
1

嗨,大家好我有一個de feed對話框的奇怪問題。 它的工作原理pefect在Firefox,但是當我試圖把它用在IE或Chrome我得到這個錯誤「發生錯誤,請稍後再試Feed對話框在某些瀏覽器上不起作用

我試圖修復它,但我不能。你能幫我嗎。 這是我用來調用對話框的代碼。

<div id='fb-root'></div> 
<script src='http://connect.facebook.net/en_GB/all.js'></script> 
<a href="#" onclick='postToFeed(); return false;'>Post Feed</a> 


    <script> 
    FB.init({appId: "xxxx", status: true, cookie: true}); 
    function postToFeed() { 
      // calling the API ... 
      var obj = { 
       method: 'feed', 
       link: 'http://apps.facebook.com/xxxx', 
       picture: 'xxxx', 
       name: 'xxxx', 
       caption: 'xxxxx', 
       description: 'xxxxx', 
       properties: [{text: 'xx', href: 'xx'},], 
       actions: [{name: 'xx', link: 'xx'}], 
      }; 

      function callback(response) { 
       document.getElementById('msg').innerHTML = "Well Done!!"; 
      } 

      FB.ui(obj, callback); 
      } 

     </script> 
    </script> 

回答

0

幾件事情嘗試:

1:它可能是在你的代碼在這裏流氓逗號後的操作一樣簡單:

actions: [{name: 'xx', link: 'xx'}], 

嘗試刪除,但鍍鉻應該更好地處理,但這會導致IE的問題!

2:使用控制檯查看是否引發任何錯誤。

3:添加的OAuth:忠於你的初始化語句,像這樣:

FB.init({appId: "xxxx", status: true, cookie: true, oauth: true}); 

4:刪除在調用的參數,並通過一個測試它的工作原理,每次添加後添加他們回來一:啓動與:

var obj = { 
       method: 'feed', 
       link: 'http://apps.facebook.com/xxxx', 
       picture: 'xxxx', 
       name: 'xxxx', 
       caption: 'xxxxx', 
       description: 'xxxxx' 
      }; 
+0

感謝您的幫助,我發現腳本與社交插件的代碼碰撞的promblem。 –