未捕获的 ReferenceError:未使用 facebook API 定义 checkLoginState [英] Uncaught ReferenceError: checkLoginState is not defined using facebook API

查看:31
本文介绍了未捕获的 ReferenceError:未使用 facebook API 定义 checkLoginState的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试修复此代码,但在控制台上遇到此错误:

I keep trying to fix this code but I am stuck with this error on my console:

未捕获的引用错误:未定义 checkLoginState.

Uncaught ReferenceError: checkLoginState is not defined.

我只是遵循了本指南.这是我调用此函数时的代码:

I simply followed this guide. Here is my code for this function and when I call it:

function checkLoginState() {
  FB.getLoginStatus(function(response) {
    statusChangeCallback(response);
  });
}


<fb:login-button data-max-rows="1" data-size="large" data-show-faces="false" data-auto-logout-link="true" onlogin="checkLoginState();" scope="public_profile, pages_show_list"></fb:login-button>

推荐答案

这个:

function checkLoginState() {
  FB.getLoginStatus(function(response) {
    statusChangeCallback(response);
  });
}

应该在你的

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆