JavaScript运行时错误:[Messenger]未提供所需的属性'target' [英] JavaScript runtime error: [Messenger] Required property 'target' was not provided occurred
问题描述
我正在使用Developers API和我在LinkedIn中创建的应用程序.
I am using the Developers API with an App I created in LinkedIn.
当我调用此方法登录时.....
When I call this method to sign in.....
IN.UI.Authorize().params({"scope":["r_liteprofile","r_emailaddress"]}).place()
IN.UI.Authorize().params({ "scope": ["r_liteprofile", "r_emailaddress"] }).place()
一个窗口开始打开,我收到以下错误消息:
a Window begins to open and I get this error message:
第7行中未处理的异常,列中的56783 http://platform.linkedin.com/in.js 0x800a139e-JavaScript运行时 错误:[Messenger]未提供必需的属性目标" 发生
Unhandled exception at line 7, column 56783 in http://platform.linkedin.com/in.js 0x800a139e - JavaScript runtime error: [Messenger] Required property 'target' was not provided occurred
我已经完成了LinkedIn的应用设置,但无法确定是什么原因引起的.我的JavaScript代码如下:
I have completed LinkedIn's App Setup, but can't figure what could be causing this. My JavaScript code is below:
[script type="text/javascript" src="//platform.linkedin.com/in.js"]
api_key: 'xxxxx......xxxxx'
authorize: true
[/script]
function LinkedInSignIn() {
IN.UI.Authorize().params({ "scope": ["r_liteprofile", "r_emailaddress"] }).place();
IN.Event.on(IN, 'auth', getProfileData);
}
function getProfileData() { // Use the API call wrapper to request the member's basic profile data
IN.API.Profile("me").fields("id,firstName,lastName,email-address,picture-urls::(original),public-profile-url,location:(name)").result(function (me) {
var profile = me.values[0];
var id = profile.id;
alert(profile.firstName);
});
}
推荐答案
事实证明,此方法不起作用的原因是LinkedIn于2018年底将其停用.联系LinkIn的支持也没有太大帮助.他们只是说他们不支持他们的代码库,而是在这里将我转回给StackOverflow.
As it turned out, the reason this is not working is becuase LinkedIn discontinued it at the end of 2018. Contacting LinkIn's support wasn't much help either. They only said they do no support thier code library and referred my back here to StackOverflow.
对于任何有相同问题的人,解决方案是使用Oauth2,该文件记录在:
For anyone having the same problem, the solutions is to use Oauth2, which is documented at:
快乐编码!
格雷厄姆
这篇关于JavaScript运行时错误:[Messenger]未提供所需的属性'target'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!