我想在登录facebook时禁用facebook登录按钮。有没有办法做到这一点? 这是我的代码
<script>
$(document).ready(function(){
window.fbAsyncInit = function(){
FB.init({appId: 'MY_APP_ID', status: true, cookie: true, xfbml: true});
FB.Event.subscribe('auth.authResponseChange', function(response) {
if (response.status === 'connected'){
FB.api('/me', processFBToken);
}
else if(response.status === 'not_authorized'){
FP.login();
}
else{
FB.login();
}
});
};
$.ajaxSetup({ cache: true });
$.getScript(document.location.protocol + '//connect.facebook.net/en_US/all.js');
//process the callback response
function processFBToken(response){
if(response && response.authResponse && response.authResponse.accessToken){
var token = response.authResponse.accessToken;
$.post('/user/login', {facebookToken : token}, function(data){
})
}
}
})
</script>
在我的HTML中
<fb:login-button size="large">
Login with Facebook
</fb:login-button>
我还有另一个正常登录按钮。
<button type = 'submit' class = 'btn btn-primary' id = 'login-submit-btn'>Login</button>
当我点击“使用Facebook登录”按钮时,如何禁用该按钮。非常感谢您的帮助