LinkedIn公司关注按钮打开空白页面

时间:2018-01-23 09:02:49

标签: javascript linkedin

LinkedIn的公司关注按钮打开空白页面是否正常? 该按钮来自LinkedIn提供的javascript片段。

我禁用了我用来确保不是问题的广告拦截器。

在检查器中,我可以看到按下它提交一个GET请求,响应200 OK,空响应:

{"message":"Forbidden"}

然后打开一个空白页面。没有别的事情发生。

它发生在生产中,客户给我的代码,所以我认为他们可能错过了一些东西。所以我去了开发者网站:

https://developer.linkedin.com/plugins/follow-company

我输入了公司名称和语言,它将按钮呈现为预览,并显示要复制/粘贴的js代码。

无论我选择哪种公司或语言,结果总是一样的。空白页面打开。我在本地和服务器上测试过它。结果相同。

编辑:

这是我使用的Javascript:

{"content":{},"status":"ok"}

1 个答案:

答案 0 :(得分:0)

工作正常。

如果你在本地运行它会产生错误。如果您正在运行它没有服务器,请检查它是否在沙盒中运行,如果它在沙箱中运行使用 <iframe sandbox="allow-same-origin allow-scripts allow-popups allow-forms" 查找有关沙箱Play safely in sandboxed IFrames

的更多信息

在W3 w3 Try IT

上试试

删除所有代码并复制粘贴。

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>Check This</title>
</head>
<body>

    <script src="//platform.linkedin.com/in.js" type="text/javascript"> lang: nl_NL</script>
    <script type="IN/FollowCompany" data-id="1441" data-counter="top"></script>


</body>
</html>