使用 LinkedIn 的分享按钮时出错

发布于 2024-11-04 19:21:52 字数 562 浏览 0 评论 0原文

我正在尝试向我们的内容驱动网站添加 LinkedIn 共享按钮。我已经使用 按钮生成器 生成了嵌入代码,但是每当我尝试实际使用时按钮,我收到一个一般错误:

执行此操作时出现问题,请稍后重试。

它已经这样做了好几天了(自从我第一次添加代码以来),所以我不知道错误是在LinkedIn这边还是我的。有没有办法获得更具体的错误消息?他们提供的代码只是您粘贴的脚本标签:

<script src="http://platform.linkedin.com/in.js" type="text/javascript"></script>
<script type="IN/Share"></script>

不幸的是,LinkedIn 的“支持”论坛仅限于各种 API;没有地方可以提交有关构建按钮功能的问题。我希望其他人已经使用过这个功能并可以为我指明正确的方向。

I'm attempting to add a LinkedIn Share button to our content-driven website. I've generated the embed code using the button builder, but whenever I try to actually use the button, I get a generic error:

There was a problem performing this action, please try again later.

It's been doing this for several days (since I first added the code), so I don't know if the error is on the LinkedIn side or mine. Is there any way to get a more specific error message? The code they provide is just a script tag that you paste in:

<script src="http://platform.linkedin.com/in.js" type="text/javascript"></script>
<script type="IN/Share"></script>

Unfortunately LinkedIn's "support" forums are limited to the various API's; there's nowhere available to submit a question regarding the build-a-button functionality. I'm hoping someone else has used this function and can point me in the right direction.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

友谊不毕业 2024-11-11 19:21:53

您尝试共享的页面很可能无法通过网络访问(本地,使用 htaccess 密码或其他内容)。在我看来,LinkedIn 会尝试实际查看您正在共享的页面,如果无法访问该页面,则会向您显示此消息。

Most likely the page you are trying to share is not web accessible (local, under htaccess password or something). It looks to me like LinkedIn tries to actually look at the page you are sharing, and if it can't reach it, it gives you this message.

谁的新欢旧爱 2024-11-11 19:21:53

您共享的网址很可能未编码,请尝试对其进行编码,同时遵循 这篇文章了解更多信息。

Most likely the url which you are sharing is not encoded, try encoding that, also follow this article for more.

掌心的温暖 2024-11-11 19:21:53

确保 linkedin 共享按钮正常工作的最简单方法是使用

<!DOCTYPE html>

其他替代方案。

The easiest way to ensure the linkedin share button works properly, is to use

<!DOCTYPE html>

instead of other alternatives.

丢了幸福的猪 2024-11-11 19:21:53

查看 data-url 属性。删除“http://”并仅使用“www”。为您的网站网址。这至少解决了我的问题。

look at the data-url attrbute. Remove the "http://" and only use "www." for your website url. That fixed my issue at least.

鸠魁 2024-11-11 19:21:53

我在 xhtml 中找到了这种验证方法:

< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">

< script src="http://platform.linkedin.com/in.js" type="text/javascript">< /script>

< div id="linkedin">< /div>

< script type="text/javascript">
var po2 = document.createElement('script');     
po2.type = 'IN/MemberProfile';     
po2.setAttribute("data-id","http://www.linkedin.com/pub/luca-di-lenardo/11/4b7/3b8");    
po2.setAttribute("data-format","hover");    
po2.setAttribute("data-text","Luca Di Lenardo");    
document.getElementById("linkedin").appendChild(po2);       
< /script>

删除空格,它可以工作!

I found this way for validate in xhtml:

< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">

< script src="http://platform.linkedin.com/in.js" type="text/javascript">< /script>

< div id="linkedin">< /div>

< script type="text/javascript">
var po2 = document.createElement('script');     
po2.type = 'IN/MemberProfile';     
po2.setAttribute("data-id","http://www.linkedin.com/pub/luca-di-lenardo/11/4b7/3b8");    
po2.setAttribute("data-format","hover");    
po2.setAttribute("data-text","Luca Di Lenardo");    
document.getElementById("linkedin").appendChild(po2);       
< /script>

Remove the white space and it works!

我乃一代侩神 2024-11-11 19:21:53

如果有人遇到此错误,并且无法找出原因,我建议检查您正在共享的页面的 URL:LinkedIn 帖子检查器

因此,举例来说,如果我要查看 wikipedia.org 在共享时的外观,我会访问并输入该 URL,就像这样...

https://www.linkedin.com/post-inspector/inspect/https:%2F%2Fwww.wikipedia.org%2F

然后我看到...

但是这里有大量信息,显示了如何解析所有内容,从描述到标题再到缩略图显示的图像选择......

警告:向页面添加 og:image 标记以控制 LinkedIn 上内容的图像。

标题:维基百科

类型:文章

图片:未找到图片

描述:维基百科是一本免费的在线百科全书,由世界各地的志愿者创建和编辑,并由维基媒体基金会托管。

作者:未找到作者

发布日期:2020 年 6 月 1 日上午 6:39:59

他们甚至为您提供有关如何修复页面的说明!嘿,这里有一些关于 Wikipedia.org 的建议!

为页面头部的 og:image 提供元数据标记。例如:

If anyone is getting this error, and cannot figure out why, I recommend checking the URL of the page you're sharing with: LinkedIn Post Inspector.

So, for instance, if I were to check out how wikipedia.org looks when shared, I would visit and enter that URL, like so...

https://www.linkedin.com/post-inspector/inspect/https:%2F%2Fwww.wikipedia.org%2F

And I see...

But there's a ton of information here, showing how everything is parsed, from the description to the title to the image selection for thumbnail display...

Warning: Add an og:image tag to the page to have control over the content's image on LinkedIn.

Title: Wikipedia

Type: Article

Image: No image found

Description: Wikipedia is a free online encyclopedia, created and edited by volunteers around the world and hosted by the Wikimedia Foundation.

Author: No author found

Publish date: 6/1/2020, 6:39:59 AM

They even give you instructions on how to fix your page! Hey, got some advice for Wikipedia.org here!

Provide a metadata tag for the og:image in the page's head section. For example:

<meta name="image" property="og:image" content="[Image URL here]">

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文