Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Re-parsing a facebook HTML5 comments box

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.

like image 356
Nick Dima Avatar asked Jan 14 '12 18:01

Nick Dima


3 Answers

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

like image 174
Felipe Brahm Avatar answered Nov 10 '22 03:11

Felipe Brahm


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.

like image 2
Shannon Smith Avatar answered Nov 10 '22 04:11

Shannon Smith


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.

like image 2
Leonidaz Avatar answered Nov 10 '22 05:11

Leonidaz