我使用该代码生成访问令牌与facebook jssdk并使用pre将生成的代码插入到同一个文件中,但它不起作用
<fb:login-button scope="offline_access, manage_pages">Grant offline_access</fb:login-button>
<h1>Access Token:</h1>
<pre id="access-token"></pre>
<script>
var
pre = document.getElementById('access-token'),
showSession = function(response) {
var html = 'Not Connected';
if (response.authResponse) {
html = response.authResponse.accessToken;
}
pre.innerHTML = html;
};
FB.getLoginStatus(function(response) {
showSession(response);
FB.Event.subscribe('auth.sessionChange', showSession);
});
</script>
同样单词“Not Connected:未在页面中显示
”