【发布时间】:2012-09-03 17:14:11
【问题描述】:
我正在使用下面的代码并尝试在我的本地机器上运行。我无法连接到 facebook。可能是什么问题?
<html>
<head>
<title>My Facebook Login Page</title>
</head>
<body>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '', // App ID
channelUrl : ' ', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
function publish(){
FB.ui({ method: 'feed',
message: 'Facebook for Websites is super-cool'});
};
}
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "http://connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
</script>
<button onclick="publish()">PUBLISH ON FACEBOOK</button>
</body>
</html>
【问题讨论】:
-
您还包括 FB 库...在哪里? FB 有宏伟的幻想和不可或缺的幻想,但它还没有大到它的库默认内置在浏览器中。
-
什么是 FB 库?我应该在哪里包括它?如果您询问 APP ID,我有它和频道 URL,因为它是可选的,所以我将其留空。对不起,我对这件事很陌生,所以我问这个微不足道的疑问..
标签: facebook post message local