我正在使用 https://validator.w3.org验证我的 HTML 5 网站。我正在使用 Linkedin javascript 登录 SDK。我遵循了本教程 https://developer.linkedin.com/docs/signin-with-linkedin
我遇到了这个错误
The text content of element script was not in the required format: Expected space, tab, newline, or slash but found a instead.
在这个代码块中
<script type="text/javascript" src="//platform.linkedin.com/in.js">
api_key: YOUR_API_KEY_HERE
authorize: true
onLoad: onLinkedInLoad
</script>
这个代码是教程提供的问题。
最佳答案
我通过分离 API 的加载和 API 的启动解决了这个问题。
<script src="http://platform.linkedin.com/in.js?async=true"></script>
<script>
IN.init({
api_key: 'YOUR_API_KEY_HERE',
onLoad: onLinkedInLoad,
authorize: true,
scope: 'r_basicprofile r_fullprofile r_emailaddress r_contactinfo',
});
</script>
此代码是 W3C 的有效代码
关于javascript - 使用 Linkedin 代码登录给我 html 验证错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33882617/