在我的网站上,我有一个邀请选项。点击并连接到Facebook邀请你的朋友,但他们将在我的网站同一页(例如ajax或iframe方法)。
但我还没有找到任何适用于jQuery或PHP的工作示例。有没有人可以指导我的工作链接,这确实做了我是如何尝试实现。
我试过了,但似乎对jQuery和PHP不起作用。例如:http://connect.facebook.net/en_US/all.js
发布于 2011-04-06 23:25:00
最后,这就是答案,让生活变得简单和快乐,希望它能帮助其他人:
步骤1:复制并粘贴以下代码,并使用您自己的facebook开发人员id更改appId。
<p><fb:login-button autologoutlink="true"></fb:login-button></p>
<!-- <p><fb:like></fb:like></p>-->
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {FB.init({appId: '133500<--put your-->developerid', status: true, cookie: true,xfbml: true});FB.Event.subscribe('auth.sessionChange', function(response) {if (response.session) {FB.ui({method: 'apprequests', title:'Invite your friends to my cool site!', message: 'You have been invited to this cool site'});} else {}}); };(function() {
var e = document.createElement('script');
e.type = 'text/javascript';
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
</script>
第二步:点击facebook图标,登录,并用你自己的信件邀请其他人?
https://stackoverflow.com/questions/4842457
复制相似问题