Javascript Linkedin API不支持个人资料数据

Javascript Linkedin API不支持个人资料数据,javascript,api,linkedin,Javascript,Api,Linkedin,我正在使用linkedin的JSAPI获取一些用户配置文件信息。我的标题中有: <script type="text/javascript" src="http://platform.linkedin.com/in.js"> api_key: xxxxx authorize: false onload: getProfileData </script> 有人知道这个问题可能是什么或者如何解决吗?提前感谢您的代码中似乎有许多错误: 首先,使用带有onLoad回调的auth

我正在使用linkedin的JSAPI获取一些用户配置文件信息。我的标题中有:

<script type="text/javascript" src="http://platform.linkedin.com/in.js">
api_key: xxxxx
authorize: false
onload: getProfileData
</script>

有人知道这个问题可能是什么或者如何解决吗?提前感谢

您的代码中似乎有许多错误:

首先,使用带有onLoad回调的
authorize:false
将不起作用,因为authorize:false要求用户手动“登录”每个页面加载,而onLoad调用将使该选项从他们手中消失。其次,在引导部分中有
onload
,它应该是
onload
。以下内容将解决这两个问题:

<script type="text/javascript" src="http://platform.linkedin.com/in.js">
  api_key: xxxxx
  authorize: true
  onLoad: getProfileData
</script>

api_密钥:xxxxx
授权:正确
onLoad:getProfileData
此外,您在实际工作代码中缺少许多括号等-以下内容应适用:

<script type="text/javascript">
  function getProfileData() {
    IN.API.Profile("me")
      .fields(["firstName", "lastName", "headline", "summary"])
      .result(function(result) {
        alert(JSON.stringify(result));
      });
  }
</script>

函数getProfileData(){
IN.API.Profile(“me”)
.fields([“firstName”、“lastName”、“headline”、“summary”])
.结果(函数(结果){
警报(JSON.stringify(result));
});
}

请记住,如果您想获得更多的信息,您需要。

谢谢您的帮助。由于某种原因,它的功能不能启动。尝试了你的代码,但没有结果。奇怪。你确定onLoad有大写字母L吗?我一字不差地发布的代码对我来说很有用。是的。出于某种原因,我加入并重新命名了onLoad has函数,它成功了。谢谢你,保罗。我的onLoad函数变成了“paultoldmeso”,现在它正在运行。下面的问题是:如果用户没有登录,Profile API调用是否会无声地失败?我能听懂吗?
<script type="text/javascript" src="http://platform.linkedin.com/in.js">
  api_key: xxxxx
  authorize: true
  onLoad: getProfileData
</script>
<script type="text/javascript">
  function getProfileData() {
    IN.API.Profile("me")
      .fields(["firstName", "lastName", "headline", "summary"])
      .result(function(result) {
        alert(JSON.stringify(result));
      });
  }
</script>