我已将以下代码放在脑海中以检查会话:
<script type="text/javascript">
FB.getLoginStatus(function(response) {
if (response.session) {
alert('I am logged in');
} else {
alert('I am logged out');
}
});
</script>
但是,它不会在页面加载时执行,这是为什么呢?