Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/418.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/oop/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在没有访问令牌的情况下获取名字和姓氏?_Javascript_Html_Facebook - Fatal编程技术网

Javascript 如何在没有访问令牌的情况下获取名字和姓氏?

Javascript 如何在没有访问令牌的情况下获取名字和姓氏?,javascript,html,facebook,Javascript,Html,Facebook,根据FB SDK文档,似乎响应对象I中的一些数据应该能够检索sans访问令牌。()但是,当我执行此操作时,我会在响应对象中接收消息- An active access token must be used to query information about the current user. 有人对这件事有什么见解吗 非常感谢 编辑-我正在使用的代码: function testAPI() { console.log('Welcome! Fetching y

根据FB SDK文档,似乎响应对象I中的一些数据应该能够检索sans访问令牌。()但是,当我执行此操作时,我会在响应对象中接收消息-

An active access token must be used to query information about the current user.
有人对这件事有什么见解吗

非常感谢

编辑-我正在使用的代码:

function testAPI() {
                console.log('Welcome!  Fetching your information.... ');
                FB.api('/me', function (response) {
                    console.log('Good to see you, ' + response.name + '.');
                    console.log(response);
                });
            }

到目前为止,我的发现表明,基本信息不能被访问,除非你有“userid”或“username”,如本文所述

如果必须尝试使用以下url获取基本信息,则需要访问\u令牌

{
   "error": {
      "message": "An active access token must be used to query information about the current user.",
      "type": "OAuthException",
      "code": 2500
   }
}