FB.XFBML.parse 无法重新加载 FBML
我使用 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于 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.