hugsbrugs
hugsbrugs

Reputation: 3621

can't display facebook like button when facebook sdk loaded with requireJS

I'm correctly loading Facebook SDK with requireJS (https://developers.facebook.com/docs/javascript/howto/requirejs) because I see it in the console log message and because I can publish on users wall using FB.ui method so the hard work has been done ! But the tricky part is missing : I can't display the like and share buttons (https://developers.facebook.com/docs/javascript/quickstart).

I can see :

<div id="fb-root"></div>

is filled in after page load but the :

<div class="fb-like" data-send="true" data-width="450" data-show-faces="true"></div>

doesn't get anything inside !

What am I missing ? an initialization using FB.XX method ? No javascript error so don't know where to dig ...

Upvotes: 0

Views: 495

Answers (1)

hugsbrugs
hugsbrugs

Reputation: 3621

OK found the answer 5 sec after posting after 1 hour searching ... thanks to this page : https://github.com/thomaswelton/requirejs-facebook even if I don't use this plugin for now.

In my FB.init, I had to add the line :

xfbml      : true

witch, you would certainly agree, it's very very clear that "xfbml" means "please activate my social plugin" ! I love when variable name doesn't means anything ;)

Upvotes: 2

Related Questions