facebook JavaScript SDK - 当您只想将 SDK 用于 facebook 的“赞”按钮时,“您的应用程序 ID”是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2888554/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
facebook JavaScript SDK - what is the 'your app id' when you just want to use the SDK for the facebook 'Like' button?
提问by Techboy
I want to add the facebook 'Like' button to my website, but the JavaScript API is asking for 'your app id'
我想在我的网站上添加 Facebook 的“赞”按钮,但 JavaScript API 要求提供“您的应用程序 ID”
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({appId: 'your app id', status: true, cookie: true,
xfbml: true});
};
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
</script>
What should I put there?
我应该在那里放什么?
I could use the iframe code they give, but would prefer to use the XFBML as it will allow me to add more features in the future.
我可以使用他们提供的 iframe 代码,但更喜欢使用 XFBML,因为它允许我在未来添加更多功能。
Thanks.
谢谢。
回答by
You should create your app in the facebook developer sectionand there you will be assigned app id (application id), that is what you should put in there.
您应该在facebook 开发人员部分创建您的应用程序,并在那里为您分配应用程序 ID(应用程序 ID),这就是您应该放在那里的内容。

