Facebook Javascript SDK Problem: "FB is not defined"

Alex Miller picture Alex Miller · Dec 29, 2010 · Viewed 104.4k times · Source

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.

Answer

pbz picture pbz · Feb 7, 2011

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.