1

大家好,我对 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>
4

1 回答 1

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'
            };
于 2011-10-01T14:48:40.740 回答