我正在尝试使用javascript检查用户是否已登录Facebook(是否已登录,与我的应用程序无关)。
我尝试在FB.init之后使用以下代码:FB.getLoginStatus(function(response) {
alert(response.status);
});
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>

09-30 19:47