1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

fbAsyncInit() が読み込まれない【FacebookAPI】

Last updated at Posted at 2015-05-22

FacebookSDK等を使う際にwindow.fbAsyncInitがいつまでたっても読み込まれない場合があります。

  (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/sdk.js";
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));

これの読み込みをすべてのJSの最後にしっかり配置してあげて下さい。
SDK読み出しが始まる前にfbAsyncInitが定義されてないとダメなので。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?