【问题标题】:fb:serverfbml won't render on Opera and IEfb:serverfbml 不会在 Opera 和 IE 上呈现
【发布时间】:2010-07-12 13:17:21
【问题描述】:

我在 Facebook 开发者论坛中询问了the same question,但由于某些原因,我想在这里重新发布。我希望没关系。

我有以下 fb:serverfbml sn-p。

<fb:serverfbml id="invite_friends_form" style="width: 100%">
  <script type="text/fbml">
    <fb:fbml><p>Testing FBML rendering</p></fb:fbml>
  </script>
</fb:serverfbml>

<script>
    $(document).ready(function()
    {
        // Parse XFBML tags
        FB.XFBML.parse();
    });
</script>

它在 Firefox 和 Chrome 中正确呈现。我得到了一会通常的Facebook加载动画,然后显示“Testing FBML rendering”这句话。

但是,当我在 Opera 10 和 Internet Explorer 8 上进行测试时,它不起作用。我确实看到了 Facebook 加载动画,但它从未完成。当我看到我的网络监视器时,我看到了一个对http://www.facebook.com/plugins/serverfbml.php 的请求,其中我的待渲染 FBML 在查询字符串中传递。

请求已经完成,来自 facebook 的正确响应,但加载动画仍在继续。

有谁知道,这可能是什么问题?

谢谢,安德烈。

【问题讨论】:

  • 有什么方法可以自己测试,而无需编写自己的 fB 应用程序?
  • 恐怕不行。我还没有在公共服务器上托管应用程序。目前,我正在本地主机上测试整个事情。嘿,这会是问题吗?
  • 这里一样,FB.Event.subscribe 回调现在在 IE8 中工作

标签: internet-explorer-8 facebook opera fbml


【解决方案1】:

我一上午都遇到同样的问题,终于解决了! :)

添加:

<div id="fb-root"></div>

...你体内的某个地方。

另外,将 xmlns:fb="http://www.facebook.com/2008/fbml" 添加到 html 标记,使其显示为:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">

我将发布我的整个代码,以便您进行比较:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
    <title></title>
</head>


<body style="margin:0px 0px 0px 0px;overflow:hidden;text-align:center;">

    <div id="fb-root"></div>

    <fb:serverFbml>
        <script type="text/fbml">
            <fb:fbml>
                <fb:request-form
                    method="POST"
                    type="jugar a Mahou Liga Chapas"
                    action="http://mahouligachapas.unusualwonder.com"
                    content='¿ Te echas un partido conmigo? 
                        <fb:req-choice url="http://apps.facebook.com/mahouligachapas" label="Sí" />
                        <fb:req-choice url="http://www.facebook.com" label="No" />' 
                >
                    <fb:multi-friend-selector actiontext="Invita a tus amigos a jugar a Mahou Liga Chapas"/>
                </fb:request-form>
            </fb:fbml>
        </script>
    </fb:serverFbml>

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
    <script type="text/javascript" src="http://connect.facebook.net/es_ES/all.js"></script>

    <script type="text/javascript">
        $(document).ready(function () {
            FB.init({ appId: 'XXXXXXXXXXX', status: true, cookie: true, xfbml: true });
        });

    </script>

</body>
</html>

【讨论】:

  • 谢谢!这完全奏效了。已经尝试解决这个问题半天多了。
【解决方案2】:

我有同样的问题。但在可能的情况下,包含“(双引号)的动作参数。当我添加斜杠时问题消失了。

【讨论】:

    猜你喜欢
    • 2014-05-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-23
    相关资源
    最近更新 更多