我想触发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));