我正在尝试使用 javascript 检查用户是否已登录 Facebook(是否刚刚登录,与我的应用程序无关)。
我尝试在 FB.init 之后使用以下代码:
FB.getLoginStatus(function(response) {<br/>
alert(response.status);<br/>
});
不过,edge.create 工作得很好。
最佳答案
有一些技巧可以提供帮助,但不适合您的情况。 https://grepular.com/Abusing_HTTP_Status_Codes_to_Expose_Private_Information
这是一个简单的例子:
<html>
<head>
</head>
<body>
// At the end of page will be good
<script>
function logged() {
alert('logged');
}
function notlogged() {
alert('not logged');
}
</script>
<script src="http://www.facebook.com/ajax/composer/attachment/question/question.php" onload="logged()" onerror="notlogged()">
</body>
</html>
关于javascript - 检查用户是否登录 Facebook,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5654473/