How to workaround 'FB is not defined'?

前端 未结 12 1261
余生分开走
余生分开走 2020-12-04 17:56

Sometimes I\'m getting the \"FB is not defined\" issue when loading the http://connect.facebook.net/en_US/all.js

I\'ve realized that the problem is because sometime

12条回答
  •  孤街浪徒
    2020-12-04 18:35

    FB recommends to add the async all.js include right after body, so that FB object get prepared when you use it in page.

    You can also have artificial delay using setTimeout to make sure FB object is loaded. e.g.

    
    

提交回复
热议问题