重新解析 Facebook HTML5 评论框

发布于 2024-12-27 04:10:58 字数 125 浏览 3 评论 0原文

是否有类似于 FB.XFBML.parse() 但适用于 HTML5 版本的社交插件的东西?我不想使用 XFBML... 基本上,我正在构建一个单页应用程序,需要更改评论框的 data-href 属性并根据应用程序内访问的内容重新加载。

Is there something similar to FB.XFBML.parse() but for the HTML5 versions of the social plugins? I don't want to use XFBML...
Basically, I'm building a one page application that needs to change the comments box's data-href attribute and reload based on what content is accessed inside the app.

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

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

发布评论

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

评论(3

倾城月光淡如水﹏ 2025-01-03 04:10:58

调用 FB.XFBML.parse() 还将重新加载/重新解析 HTML5 Like 按钮和其他 Facebook HTML5 社交插件。

Calling FB.XFBML.parse() will also reload/reparse HTML5 Like buttons and other Facebook HTML5 social plugins.

陌生 2025-01-03 04:10:58

如果其他人遇到这种情况,FB.XFBML.parse() 可以完美工作,除非您传递一个参数来仅重新解析文档的一部分。

In case somebody else comes across this, FB.XFBML.parse() works perfectly unless you pass a parameter to re-parse only part of the document.

素手挽清风 2025-01-03 04:10:58

如果您想在特定元素上调用 FB.XFBML.parse( document.getElementById('foo') ),请确保该元素包含 HTML5 社交插件,而不是社交插件本身。

否则,FB.XFBML.parse() 应该在所有情况下都有效,但它会扫描整个 DOM。

If you want to call FB.XFBML.parse( document.getElementById('foo') ) on a specific element, make sure this element contains the HTML5 social plugin and not the social plugin itself.

Otherwise, FB.XFBML.parse() should work in all cases but it will scan the whole DOM.

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