Web サイトの Facebook ログインで問題が発生しました。以下のコードは、私の FB-Connect コードです。コードのコメント部分は、私の Web サイトにサインインします。私の問題は、このコードを「再アクティブ化」すると、ページにアクセスするたびに即座にログインすることです。しかし、ユーザーが「Facebookでログイン」ボタンをクリックしたときにログインしたいと思います。Facebookのログインボタンをクリックすると、ポップアップが表示され、何も起こりません..
FB-Connect ボタンをクリックしたときに、どうにかして JS 関数を呼び出すことはできますか?
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'xxxxxxxxxxxxxxxxxx', // App ID
status : true,
cookie : true,
xfbml : true,
oauth : true,
});
var login = false;
FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
console.log('connected');
login=true;
var uid = response.authResponse.userID;
//this part of the code below redircts me to the part, where i login to my system.
/*var accessToken = response.authResponse.accessToken;
$.ajax({
type: 'POST',
url: '/?eID=login',
data: $(this).serialize(),
success: function(msg) {
alert("LOGIN");
$('#content').load('/live-session/tickets/');
}
});*/
}});