我想从我的Facebook页面发布帖子,任何人都可以告诉我要做的步骤吗?我在网络上看到解决方案,但无法得到该做什么,任何人都可以帮助我做到这一点?我只有这个代码。如何使用javascript或php从facebook页面获取帖子
<html>
<script src="https://connect.facebook.net/en_US/all.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<body>
<p><a href="#" onClick="logInWithFacebook()">Log In with the JavaScript SDK</a></p>
<script>
logInWithFacebook = function() {
FB.login(function(response) {
if (response.authResponse) {
alert('You are logged in & cookie set!');
// Now you can redirect the user or do an AJAX request to
// a PHP script that grabs the signed request from the cookie.
} else {
alert('User cancelled login or did not fully authorize.');
}
});
return false;
};
window.fbAsyncInit = function() {
FB.init({
appId: 'my-app-key',
cookie: true, // This is important, it's not enabled by default
version: 'v2.2'
});
};
</script>
</body>
</html>
“我只是有这个工作代码”你确定吗? – byxor
错误的是:“无法加载网址:此网址的网域未包含在应用的网域中,为了能够加载此网址,请将您的应用的所有网域和子网域添加到应用中的应用网域字段设置“。 –
所以你的代码_isn't_然后工作。你应该在你的问题中解决这个错误。 – byxor