FB.XFBML.parse 无法重新加载 FBML

发布于 2024-11-29 11:49:02 字数 848 浏览 7 评论 0原文

我使用 AJAX 请求加载以下内容。它适用于非 ajax 请求。

<div class='center' id='fb_invite_box'>
    <fb:serverfbml width="646" id="serverFbml">
          <script type="text/fbml" id="textFbml">
            <fb:request-form method='post' action='<%=invites_url%>' type='test' invite='true' content="test text">
                <fb:multi-friend-selector actiontext='Invite your friends to my app!' rows='3' cols='4' import_external_friends='false' email_invite='true'/>
            </fb:request-form>
          </script>    
    </fb:serverfbml>
</div>

我根据我在 ajax 请求后渲染 FBML 的知识来运行这个。

FB.XFBML.parse(document.getElementById('fb_invite_box'));

我收到此错误:

<fb:serverfbml> requires the "fbml" attribute.

我错过了什么吗?为什么这不起作用?

I load the following with an AJAX request. It works fine with non-ajax requests.

<div class='center' id='fb_invite_box'>
    <fb:serverfbml width="646" id="serverFbml">
          <script type="text/fbml" id="textFbml">
            <fb:request-form method='post' action='<%=invites_url%>' type='test' invite='true' content="test text">
                <fb:multi-friend-selector actiontext='Invite your friends to my app!' rows='3' cols='4' import_external_friends='false' email_invite='true'/>
            </fb:request-form>
          </script>    
    </fb:serverfbml>
</div>

I run this from what I learned about rendering FBML after an ajax request.

FB.XFBML.parse(document.getElementById('fb_invite_box'));

I get this error:

<fb:serverfbml> requires the "fbml" attribute.

Am I missing something? Why doesn't this work?

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

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

发布评论

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

评论(1

错爱 2024-12-06 11:49:02

由于 FBML 很快就会被弃用 (https://developers.facebook.com/docs/reference/fbml/),我建议使用新的 https://developers.facebook.com/docs/reference/dialogs/requests/ 用于邀请人们使用您的应用的请求对话框。

Since FBML is being deprecated (https://developers.facebook.com/docs/reference/fbml/) very soon, I'd suggest using the new https://developers.facebook.com/docs/reference/dialogs/requests/ Requests Dialog to invite people to your app.

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