Re-parsing a facebook HTML5 comments box
Asked Answered
S

3

9

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.

Simons answered 14/1, 2012 at 18:11 Comment(1)
Since HTML5 widget has been arnd for so long, how come they didn't covered this in documentation, yet? Anyways, let me know if you find out sth.Etheridge
D
12

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

Dreary answered 5/2, 2012 at 3:46 Comment(1)
is this still working? With FB API Impl/Docs so far from each other, HTML5 widgets are big let down.Etheridge
S
2

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.

Sula answered 21/5, 2012 at 2:20 Comment(1)
And what if I want to pass only part of the document?Contrariety
E
2

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.

Epigenous answered 26/7, 2013 at 22:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.