所以我试图为热点登录页面,用户使用facebook登录,然后重定向到路由器以访问互联网,但无论我尝试Facebook登录按钮刚刚出现。这是一个简单的代码,试图使按钮显示但它只是赢得了工作
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>facebook login </title>
</head>
<body>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '1749574641802184',
cookie : false,
xfbml : true,
version : 'v3.0'
});
FB.getLoginStatus(function(response) {
statusChangeCallback(response);
});
};
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = 'https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.0&appId=2034911913423175&autoLogAppEvents=1';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));;
function statusChangeCallback(response){
if(response.status === "conected"){
setElements(true);
console.log("logged in and authenticated");
}
}
function checkLoginState() {
FB.getLoginStatus(function(response) {
statusChangeCallback(response);
window.top.location = "";
});
}
</script>
<fb:login-button
scope="public_profile,email"
onlogin="checkLoginState();">
</fb:login-button>
<div class="fb-login-button" data-width="300" data-max-rows="1" data-size="large" data-button-type="continue_with" data-show-faces="false" data-auto-logout-link="false" data-use-continue-as="false"></div>
</body>
</html>
感谢任何建议