使用Java的Linkedin错误提示

问题描述

我想在我的网页上实现“使用Linkedin注册”,但是我一直在控制台上遇到错误

Uncaught (in promise) TypeError: Could not instantiate tag for 'login': Cannot read property 'on' of null
at new <anonymous> (Login.js?version=0.1.149:7)
at in.js:18

我尝试了Internet上几乎所有可用的方法,但还没有走运。我敢肯定,这种方法现在已经过时了,并且有一种新的方法可以做到这一点,但是在任何论坛上都还没有。

这是我正在运行的:

<HTML>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript" src="https://platform.linkedin.com/in.js">
api_key: <API Key>
authorize: true
onLoad: onLinkedInLoad
</script>
<script type="text/javascript">
// Setup an event listener to make an API call once auth is complete
function onLinkedInLoad() {
 IN.Event.on(IN,"auth",getProfileData);
}
// Use the API call wrapper to request the member's basic profile data
function getProfileData() {
IN.API.Profile("me").fields("first-name","last-name","email-address").result(function (data) {
var userdata = data.values[0];
console.log('FName: ' + userdata.firstName);
console.log('LName: ' + userdata.lastName);
console.log('Email: ' + userdata.emailAddress);
}).error(function (data) {
console.log(data);
});
}
</script>
</head>
<body>
<!-- LinkedIn signin button -->
<script type="IN/Login" data-onAuth="onLinkedInAuth"></script>
</body>
</html>

谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...