The following code, copied from the Facebook documentation here, is not working for me in Chrome.
<div id="fb-root"></div> <script src="http://connect.facebook.net/en_US/all.js"></script> <script> FB.init({ appId : 'YOUR APP ID', status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML }); </script>
In the Javascript console I get:
Uncaught ReferenceError: FB is not defined
I'm not having any problems with the SDK in Firefox or Safari, just Chrome.
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.
Init the Facebook SDK in a React App Before Startup The below initFacebookSdk() function runs before the React app starts up to load and initialize the Facebook SDK, and automatically log the user into the React app if they are already logged in with Facebook. The init Facebook SDK function is called from the index.
I saw a case where Chrome had installed WidgetBlock which was blocking the Facebook script. The result was exactly this error message. Make sure you disable any extensions that may interfere.
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