[英]Facebook login-button doesn't work in IE8
我在这里遇到了一个很奇怪的问题,我已经使用Facebook登录按钮很长时间了,现在它在我正在开发的新网页上不起作用。 这是代码:
<!DOCTYPE html>
<html xmlns:fb="http://www.facebook.com/2008/fbml">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Woyou</title>
<link rel="stylesheet" href="./styles/styles16.css" type="text/css" id="css"/>
<script type="text/javascript" src="./js/saved_resource" type="text/js/default.I.js"></script>
<script type="text/javascript" charset="UTF-8">
function init() {
var screenX = screen.width;
var screenY = screen.height;
var screenRes = screenX/screenY;
screenRes = screenRes.toFixed(2);
if (screenRes == 1.60){
document.getElementById("css").href= "./styles/styles16.css";
} else if (screenRes == 1.77){
document.getElementById("css").href= "./styles/styles17.css";
} else if (screenRes == 1.33){
document.getElementById("css").href= "./styles/styles13.css";
} else if (screenRes == 1.25){
document.getElementById("css").href= "./styles/styles12.css";
}
}
</script>
</head>
<body onload="init();" onunload="" onkeydown="return keyDown(event);" onkeyup="return keyUp(event);" id="body" style="overflow-x: hidden; overflow-y: hidden;">
<div id="fb-root"></div>
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({
appId : '275229992538227', // App ID
channelUrl : '//www.ihaveseen.org/index.html',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
oauth : true,
xfbml : true //, // parse XFBML
//frictionlessRequests : true
});
FB.getLoginStatus(function(response) {
if (response.status == 'connected') {
alert("conex");
} else {}
});
};
(function() {
var e = document.createElement('script');
e.type = 'text/javascript';
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
<div class="snwbuttons" style="position: absolute; left: 70%; top: 20%; width: 5%; height: 5%; text-align: left;">
<div class="facebook-plugin" style="position: absolute; left: 5%; top: 15%; text-align: left;"><fb:login-button autologoutlink='true' perms='email,user_birthday,status_update,publish_stream,user_location,user_hometown,user_online_presence,friends_online_presence'></fb:login-button></div>
</div>
它过去对我来说非常好用,但我不知道为什么现在不行,我已经检查了这里的一些相关问题,并尝试以不同的方式更改代码。
检查您的JavaScript代码是否有错误。 IE8不喜欢多余的“,”,在代码ID中没有其他内容。 尝试从中删除多余的逗号:
xfbml : true //, // parse XFBML
//frictionlessRequests : true
通过在线棉绒工具运行代码会有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.