fb:serverfbml 不会在 Opera 和 IE 上呈现

发布于 2024-09-09 05:56:08 字数 1003 浏览 2 评论 0原文

我在 Facebook 开发者论坛中提出了同样的问题,但出于某些原因我想在这里重新发布。我希望没关系。

我有以下 fb:serverfbml 片段。

<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 加载动画,然后显示了“测试 FBML 渲染”这句话。

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

该请求已经完成并得到了 Facebook 的正确响应,但加载动画仍在继续。

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

谢谢,安德烈。

I asked the same question in Facebook developer forum, but for some reasons I want to repost it here. I hope that's okay.

I have the following fb:serverfbml snippet.

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

It renders correctly in Firefox and Chrome. I got the usual Facebook loading animation for a moment, and then the sentence "Testing FBML rendering" is displayed.

BUT, when I test this on Opera 10 and Internet Explorer 8, it doesn't work. I do see the Facebook loading animation, but it never finished. When I see my network monitor, I saw a request to http://www.facebook.com/plugins/serverfbml.php with my to-be-rendered FBML passed in the query string.

The request is already completed with proper response from facebook, but still, the loading animation goes on.

Does anyone know, what might be the problem here?

Thanks, Andree.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

懵少女 2024-09-16 05:56:08

同样的问题困扰了我一上午,终于解决了! :)

添加:

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

I have had the same problem for the whole morning, and I finally solved it! :)

Add:

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

...some place inside your body.

Also, add xmlns:fb="http://www.facebook.com/2008/fbml" to the html tag, so that it reads:

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

I'm going to post my whole code so that you can compare:

<!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>
筑梦 2024-09-16 05:56:08

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

I had same problem. But in may case action parameter of contained " (double quote). When I added slashes problem gone.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文