페이스북 developer 에서 app을 새로 생성하면 주는 key를 입력해주면 된다.
You wanted to have Facebook Like Button or Facebook Like Box and other Facebook social plugins on your website. You copy pasted to code Facebook generated for you on your web pages. If you do not have an App ID when you copied this, chances are the Facebook script will complain in your Web Browser’s console (e.g Firebug Console).
Invalid App Id: Must be a number or numeric string representing the application id. FB.getLoginStatus() called before calling FB.init(). all.js#xfbml=1 (line 56) |
To fix this issue, just do a “Create New App” in the Apps section in Facebook. And then go back to the Facebook Social Plugins page, pick a plugin, and regenerate the code for it.
Your Facebook plugin code before having an App ID:
<div id="fb-root"></div> <script>(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/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> |
After you have assigned an App to the plugin
<div id="fb-root"></div> <script>(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/all.js#xfbml=1&appId=<your-16-digit-app-id>"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> |
Notice the difference in the highlighted code? Let me know if this solved your problem in the comment area.
'웹프로그래밍 > Javascript' 카테고리의 다른 글
jQuery DatePicker 버튼 만들기 (동적 생성) (0) | 2015.10.03 |
---|---|
javascript comma and uncomma (0) | 2015.10.01 |
지정된 영역만 인쇄하기 (0) | 2015.06.15 |
Javascript iBook EPUB 3.0 Images not working (0) | 2015.05.27 |
jQuery $("img").load non-cache (0) | 2015.05.26 |