【发布时间】:2015-12-29 22:34:41
【问题描述】:
当我尝试使用linkedin 编写登录代码时,出现如下错误。
未捕获的错误:您必须指定一个有效的 JavaScript API 域作为此密钥配置的一部分。
下面是我的 JavaScript 代码
<script type="text/javascript" src="//platform.linkedin.com/in.js">
api_key: ######//keep it secret
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);
}
// Handle the successful return from the API call
function onSuccess(data) {
// Pre-populate your form fields here once you know the call
// came back successfully
}
// Handle an error response from the API call
function onError(error) {
console.log(error);
}
// Use the API call wrapper to request the member's basic profile data
function getProfileData() {
IN.API.Raw("/people/~:(firstName,lastName,emailAddress)").result(onSuccess).error(onError);
}
</script>
【问题讨论】:
标签: javascript java jakarta-ee linkedin-api