Facebook连接生日烫发
我对Facebook connect有点问题,关于生日许可 在html正文中,我有:Facebook连接生日烫发,facebook,connect,fbconnect,Facebook,Connect,Fbconnect,我对Facebook connect有点问题,关于生日许可 在html正文中,我有: <div class="fb-login-button" scope="user_birthday, user_about_me" perms="email,user_birthday"> Login with Facebook </div> 使用Facebook登录 在标题上,对于jS,我有: <script> // Additional JS function
<div class="fb-login-button" scope="user_birthday, user_about_me" perms="email,user_birthday"> Login with Facebook </div>
使用Facebook登录
在标题上,对于jS,我有:
<script>
// Additional JS functions here
window.fbAsyncInit = function() {
FB.init({
appId : 'XXXXXXX', // App ID
channelUrl : '//connect.facebook.net/en_US/all.js', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
// Additional init code here
FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
// connected
FB.api('/me??accessToken='+response.authResponse.accessToken, function(user) {
var monthfb = user.birthday.substr(0,2);
var dayfb = user.birthday.substr(3,2);
var yearfb = user.birthday.substr(6,4);
$("input[id=year]").val(monthfb);
$("input[id=month]").val(dayfb);
$("input[id=day]").val(yearfb);
$("a.age_gate_submit").click();
alert('1');
console.log(user);
//$.cookie('age_gate', 'gohome',{ expires: 99 });
window.location = "home.html";
});
}
});
};
function login() {
FB.login(function(response) {
if (response.authResponse) {
// connected
FB.api('/me??accessToken='+response.authResponse.accessToken, function(user) {
var monthfb = user.birthday.substr(0,2);
var dayfb = user.birthday.substr(3,2);
var yearfb = user.birthday.substr(6,4);
$("a.age_gate_submit").click();
alert('2');
//console.log(response.birthday);
console.log(user);
//$.cookie('age_gate', 'gohome',{ expires: 99 });
window.location = "home.html";
});
}
});
}
// 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 = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=XXXXXXX";
ref.parentNode.insertBefore(js, ref);
}(document));
</script>
//这里有额外的JS函数
window.fbAsyninit=函数(){
FB.init({
appId:'XXXXXXX',//应用程序ID
channelUrl:'//connect.facebook.net/en_US/all.js',//频道文件
状态:true,//检查登录状态
cookie:true,//启用cookie以允许服务器访问会话
xfbml:true//解析xfbml
});
//这里有额外的初始化代码
FB.getLoginStatus(函数(响应){
如果(response.status===“已连接”){
//连接的
api('/me??accessToken='+response.authResponse.accessToken,函数(用户){
var monthfb=user.birth.substr(0,2);
var dayfb=user.birth.substr(3,2);
var yearfb=user.birth.substr(6,4);
$(“输入[id=年]”).val(月);
$(“输入[id=month]”)val(dayfb);
$(“输入[id=day]”)val(yearfb);
$(“a.age\u gate\u submit”)。单击();
警报(“1”);
console.log(用户);
//$.cookie('age_gate','gohome',{expires:99});
window.location=“home.html”;
});
}
});
};
函数登录(){
FB.登录(功能(响应){
if(response.authResponse){
//连接的
api('/me??accessToken='+response.authResponse.accessToken,函数(用户){
var monthfb=user.birth.substr(0,2);
var dayfb=user.birth.substr(3,2);
var yearfb=user.birth.substr(6,4);
$(“a.age\u gate\u submit”)。单击();
警报(“2”);
//console.log(response.birthday);
console.log(用户);
//$.cookie('age_gate','gohome',{expires:99});
window.location=“home.html”;
});
}
});
}
//异步加载SDK
(职能(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=“//connect.facebook.net/en_US/all.js#xfbml=1&appId=XXXXXXX”;
ref.parentNode.insertBefore(js,ref);
}(文件);
当我点击我的按钮时,我有一个好窗口,我接受FB应用程序,但是jS没有调用任何函数,所以window.locations不起作用。但当我刷新它的好我可以采取的生日等。。。所以问题就在我接受应用程序的那一刻:请如何重定向?很抱歉,你的回答对我没有帮助。 但我找到了解决办法:
我必须实现FB.Event.subscribe(),当一个人接受登录时,这个函数就可以工作。很抱歉,你的回答对我没有帮助。 但我找到了解决办法:
我必须实现FB.Event.subscribe(),当一个人接受登录时,这个函数就起作用。你的问题不清楚-到底什么不起作用?你的问题不清楚-到底什么不起作用?