トリガーしたいfb:login-button
:
<fb:login-button show-faces="true" width="200" max-rows="1"></fb:login-button>
セカンドボタン付き。なんで?Facebook の css を調整することはできません。それをカスタム イメージの派手なボタンに置き換える必要があります。私の大きな問題は、FB ボタンの ID がわからないことと、それを与えることができないことです。
私の間違ったコード:
<script>
function Ffirst()
{
alert("first");
$("fb:login-button").click();
//$("fb:login-button").trigger("click"); //doesn't work eiter
}
</script>
<input type="submit" onclick="Ffirst()" name="savebutton" id="first" />
<fb:login-button show-faces="true" width="200" max-rows="1"></fb:login-button>
FTR:
を押すとこうなりますthe fb:login-button
FB.Event.subscribe('auth.authResponseChange', function(response) {
// Here we specify what we do with the response anytime this event occurs.
if (response.status === 'connected') {
testAPI();
}
} else if (response.status === 'not_authorized') {
FB.login();
} else {
FB.login();
}
});
// 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";
ref.parentNode.insertBefore(js, ref);
}(document));