【问题标题】:Linkedin Follow Button is not Displaying in Angular 7Linkedin关注按钮未在Angular 7中显示
【发布时间】:2020-09-28 12:56:39
【问题描述】:

这里是代码

<script src="https://platform.linkedin.com/in.js" type="text/javascript"> lang: en_US</script>
<script type="IN/FollowCompany" data-id="1337" data-counter="bottom"></script>

我用过这个文档documentation

我已经在stackblitz上实现了代码

有没有办法在 Angular 中解决这个问题?

【问题讨论】:

  • 贵公司页面的id是什么?
  • 这里是演示 ID 1337
  • 演示链接无效,https://www.linkedin.com/company/1337/admin/。公司 ID 应该是有效的 ID。
  • 它正在处理简单的 Html 文件,但不是 angular
  • JS Bin

标签: javascript angular typescript angular7 mean-stack


【解决方案1】:

使用此代码。

<script src="https://platform.linkedin.com/in.js" type="text/javascript"></script>
<script type="IN/FollowCompany" data-id="361557" data-counter="right"></script>

问题出在 in.js 脚本网址中。 Working demo

还附上截图。 如果您有任何问题,请告诉我。

【讨论】:

  • 但这不适用于 app.component.html stackblitz.com/edit/…
  • 能否请您复习一次
  • 我已将代码移至 app.component.html,但会显示 CORS 问题,您需要启用 CORS。
  • 即使在移至 app.component.html 后它也对我有用
  • 您如何通过 chrome 扩展或其他方式启用 CORS?
猜你喜欢
  • 1970-01-01
  • 2012-07-28
  • 1970-01-01
  • 2013-05-12
  • 1970-01-01
  • 2012-05-22
  • 1970-01-01
  • 2020-04-02
  • 1970-01-01
相关资源
最近更新 更多