Search code examples
facebookfacebook-likebox

I have error FB.provide is not a function in like-box on my web set


I've generate scripte to like-box from this site:

http://developers.facebook.com/docs/reference/plugins/like-box/

Generated script:

<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<div class="fb-like-box" data-href="http://www.facebook.com/mysite" data-width="720" data-height="215" data-show-faces="true" data-border-color="#aaaaaa" data-stream="true" data-header="true"></div>

I place this script in index.php file after tab as is mentioned in script description. On site I don't have any other fb plugins. In IE and mozilla I have an error:

FB.provide is not a function
[Break On This Error]   

...roperty(d))c.push(d);return c;},map:function(a,b){var c=[];for(var d=0;d<a.lengt...

I only copy and past script. Where is the problem ?

Thanks


Solution

  • This happens if you add the Facebook script twice on the site (search for "all.js").

    Source: https://stackoverflow.com/a/4084335/2440