FB init function gives wrong version error

后端 未结 20 1156
故里飘歌
故里飘歌 2020-12-08 18:18

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         


        
相关标签:
20条回答
  • 2020-12-08 19:13

    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.

    0 讨论(0)
  • 2020-12-08 19:14

    SINGLE INCLUDE—make sure the Facebook JavaScript API isn't included more than once on your page.

    (This was my problem)

    0 讨论(0)
提交回复
热议问题