English 中文(简体)
• 如何在网页上添加诸如纽顿语、丁顿语和tw子等面纱?
原标题:How to add facebook like button ,linkedin share button and twitter tweet button for each link on a page?

I have gone through many questions already asked about this problem but i didn t really get any clear solution.. I am building a web-site using asp.net and i have several links on a page. I need facebook like button, linkedin share button and twitter tweet button below each link. How can i achieve multiple buttons efficiently without much page load problem.. Also is there a way to know that the user has clicked the button and successfully liked a link...

最佳回答

我的两点

芬 兰

在超文本标签中

<html xmlns:fb="http://ogp.me/ns/fb#">

身体后的权利

<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=<YOUR APP ID HERE!!>";
  fjs.parentNode.insertBefore(js, fjs);
}(document,  script ,  facebook-jssdk ));</script>

您的联系

<fb:like href="<% Response.Write(Server.UrlEncode(linkURL)); %>" send="true" width="450" show_faces="true"></fb:like>

链接

<script src="//platform.linkedin.com/in.js" type="text/javascript"></script>
<script type="IN/Share" data-url="<% Response.Write(Server.UrlEncode(linkURL)); %>" data-counter="right"></script>

附录

<a href="https://twitter.com/share?url=<% Response.Write(Server.UrlEncode(linkURL)); %>" class="twitter-share-button" data-lang="en">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>

Essentially you just set the link url to the variable linkURL so that it will print it out to the webpage. I may be wrong, if I am please let me know and I will help you.

问题回答

暂无回答




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签