Feed Dialog无法在某些浏览器上运行

时间:2011-10-01 11:18:58

标签: facebook sdk dialog feed fb.ui

大家好我的de feed对话框有一个奇怪的问题。 它在Firefox上很有效,但当我尝试在IE或Chrome上使用它时出现此错误“发生错误。请稍后再试

我试图解决它,但我不能。你能帮我吗。 这是我用来调用对话框的代码。

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

1 个答案:

答案 0 :(得分:0)

要尝试的几件事情:

1:在行动之后,它可能就像你的代码中的流氓逗号一样简单:

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

尝试删除它,但Chrome应该更好地处理它,但这会导致IE的问题!

2:使用控制台查看是否有任何错误。

3:将oauth:true添加到你的init语句中,如下所示:

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'
            };
相关问题