您好,我遇到了与https://
. 我FB.getLoginStatus(function(response)
在我的代码中使用了函数。它仅适用于http://
但不适用于https://
. 我用谷歌搜索并找到了使用FB._https = (window.location.protocol == "https:");
. 几天前它工作得很好,但现在已经停止工作。
我的代码看起来像
<script>
FB._https = (window.location.protocol == "https:");
FB.init({
appId : '<?php echo $this->appId; ?>',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
function PostAction(custom_action)
{
console.log('out side of getlogin status');
FB.getLoginStatus(function(response)
{
console.log("in getlogin status");
if (response.authResponse) {
fbcallBack(response);
} else {
FB.login(fbcallBack, {scope:'publish_stream'});
}
});
}
</script>
我PostAction()
在 onclick 事件中被调用。我已经写console.log()
了调试代码。使用 facebook 时会触发控制台,out side of reglogin status
但不会触发. 但如果我使用它效果很好。in getlogin status
https
http://
任何机构都可以指导我这是什么问题?如何解决?
问候。