gpt4 book ai didi

facebook - 触发 fb :login-button with other button Javascript

转载 作者:行者123 更新时间:2023-12-02 17:43:26 24 4
gpt4 key购买 nike

我想触发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:当我按下 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));

最佳答案

@Lix 在代码中的回答:

<input type="submit" onclick="FB.login()"/>

关于facebook - 触发 fb :login-button with other button Javascript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17828761/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com