【问题标题】:Feed Dialog not working on some browsers提要对话框在某些浏览器上不起作用
【发布时间】:2026-01-21 10:10:01
【问题描述】:

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

【问题讨论】:

    标签: facebook sdk dialog feed fb.ui


    【解决方案1】:

    有几件事可以尝试:

    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'
                };
    

    【讨论】:

    • 感谢您的帮助我发现了脚本与社交插件代码冲突的问题。
    最近更新 更多