I\'m using the Facebook JS sdk, and I have created a new App today. Everything is configured properly. Using init function like:
window.fbAsyncInit = functio
This was happening to me too with great inconsistency. Somewhere my hunch said, it is got to be a timing issue. Further debugging, found out an error in developer console by manually executing "FB.login()
". The error said, "init not called with valid version".
In my case, I was adding //connect.facebook.net/en_US/sdk.js
as a script tag in the header of the html page and the window.fbAsyncInit
came in another file just after that. This pointed to me as a timing issue and hence I swapped these 2 script tags. Now once I had included window.fbAsyncInit
before including //connect.facebook.net/en_US/sdk.js
, the problem was gone. Hope this helps others.
SINGLE INCLUDE—make sure the Facebook JavaScript API isn't included more than once on your page.
(This was my problem)