我在我的 ReactJS 应用程序中使用以下 LinkedIn 共享插件:
<script src="https://platform.linkedin.com/in.js" type="text/javascript">lang: en_US</script>
<script type="IN/Share" data-url="https://www.linkedin.com"></script>
来自 LinkedIn 文档:https : //docs.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/plugins/share-plugin
它在 Chrome/Firefox/Safari 上运行良好。但是,在单击 LinkedIn 共享按钮(由上述脚本生成)时,会出现 LinkedIn 共享弹出窗口,并且我的应用程序控制台中出现错误,其中显示:
[对象错误]:{描述:“[信使] 未提供必需的属性‘目标’”,消息:“未提供[信使] 所需的属性‘目标’”,nr@seenError:true,堆栈:“错误:[ Messenger]在 Array.prototype.forEach(本机代码)的匿名函数(https://platform.linkedin.com/xdoor/scripts/in.js:7:55143)在 t(https)中未提供必需的属性“目标” ://platform.linkedin.com/xdoor/scripts/in.js:7:54936 ) 在 e ( https://platform.linkedin.com/xdoor/scripts/in.js:7:56462 ) 在 e ( https ://platform.linkedin.com/xdoor/scripts/in.js:7:34661 ) 在value ( https://platform.linkedin.com/xdoor/scripts/in.js:18:23834 ) 在 s (https://platform.linkedin.com/xdoor/scripts/in.js:18:38221 ) 在 nrWrapper ([MY_SITE_LINK_ADDRESS]:9:16587)"}
注意:我隐藏了 [MY_SITE_LINK_ADDRESS]。