简体   繁体   English

LinkedIn分享按钮奇怪的行为

[英]LinkedIn share button weird behavior

I am trying to implement a LinkedIn share button with a counter.我正在尝试使用计数器实现 LinkedIn 共享按钮。 I have used to button that was generated on the site but that didn't work.我已经习惯了在网站上生成的按钮,但它不起作用。 Now I found another method that works on a test site of mine, but when I implement it in my final site it shows some weird behavior.现在我找到了另一种适用于我的测试站点的方法,但是当我在最终站点中实现它时,它显示出一些奇怪的行为。

Sometimes it shows up on where it should be, and sometimes it just shows up on the bottom left of the site (all the way down) and it's not clickable.有时它会显示在它应该在的位置,有时它只显示在网站的左下角(一直向下)并且不可点击。

The code I've used is:我使用的代码是:

<h1> Linkedin share </h1>
<script type="text/javascript" src="http://platform.linkedin.com/in.js"></script>
<script type="in/share" data-counter="right" data-success="LinkedInShare"></script>
<script type="text/javascript">LinkedInShare();</script>

<!-- Google Analytics Social Button Tracking -->
<script type="text/javascript" src="/js/ga_social_tracking.js"></script>
<!-- LinkedIn Share Button tracking-->
<script type="text/javascript">
function LinkedInShare() {
_gaq.push(['_trackSocial', 'LinkedIn', 'Share']);
}
</script>

Has anyone had the same problem?有没有人有同样的问题? Or can someone tell me what I'm doing wrong?或者有人可以告诉我我做错了什么吗?

I'm using ASP.NET and C# in my web application我在我的 web 应用程序中使用 ASP.NET 和 C#

Sounds like there is a JS or CSS issue with your markup and the plugin.听起来您的标记和插件存在 JS 或 CSS 问题。 You should go the the LinkedIn Developer site and post an issue in the forums with the URL of a page that can reproduce the issue.您应该 go 到 LinkedIn 开发者网站并在论坛中发布一个问题,该问题的页面的 URL 可以重现该问题。

Also, FYI, the data-success callback is currently broken.另外,仅供参考,数据成功回调当前已损坏。 It will be fixed soon.很快就会修复。

The easiest way to ensure the LinkedIn share button works properly, is to use确保 LinkedIn 共享按钮正常工作的最简单方法是使用

<!DOCTYPE html>

instead of other alternatives.而不是其他选择。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM