At the top of my page I put this:
<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
Then in the body I do this:
<div id="fb-root"></div>
Then I have this later on in the page:
<fb:login-button perms="publish_stream">Connect with Facebook</fb:login-button>
And then in my JQuery document ready I have this:
FB.init({
appId: '115************', cookie: true,
status: true, xfbml: true
});
In FF, everything loads fine, and when I click Connect with Facebook, everything works fine. In EVERY other browser, everything LOADS fine, but when I click Connect with Facebook, I get this error:
FB.login() called before calling
FB.init().
Any ideas?
P.S. Puttin the init() script in the head of the document doesn’t work either. Gives the same error.
P.P.S. Moving init() to the <head> makes it work for IE and FF now, but not Safari or Chrome.
One thing to consider is that
<div id="fb-root"></div>should always be the last thing on the page, right before the closing</body>tag.Updated:
Also, instead of calling FB.init() in your document.ready, do what Facebook documentation suggests and put it in the
fbAsyncInitblock: