The content within the app is being updated using XHR. This involves changing the URL of the comment box:
<div class="fb-comments" data-href="http://example.com?id=[dynamic]" data-num-posts="2" data-width="470"></div>
Upon creating a new Facebook widget placeholder after the page been fully loaded, how do I request Facebook JS SDK to render new elements on the page?
src = "https://connect.facebook.net/en_US/sdk.js"; fjs. parentNode. insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); }, []); return ( <div><button onClick={onLoginClick}>Login with Facebook</button></div> ); };
The Facebook SDK for JavaScript provides a rich set of client-side functionality that: Enables you to use the Like Button and other Social Plugins on your site. Enables you to use Facebook Login to lower the barrier for people to sign up on your site. Makes it easy to call into Facebook's Graph API.
Call the JavaScript SDK's FB.XFBML.parse();
function after you dynamically insert the fb-comments div.
See: http://developers.facebook.com/docs/reference/javascript/FB.XFBML.parse/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With