Facebook,Twitter和Google +1按钮仅使用HTML(无Javascript) [英] Facebook, Twitter, and Google +1 buttons using only HTML (No Javascript)

查看:103
本文介绍了Facebook,Twitter和Google +1按钮仅使用HTML(无Javascript)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有一种方法来创建Facebook,Twitter和Google +1的分享按钮,仅使用HTML,而无需任何Javascript插入到代码中。

I would like to know if there is a method to create "share" buttons for Facebook, Twitter and Google +1 using only HTML, without any Javascript having to be inserted into the code at any point.

例如,您可以使用下面描述的方法动态创建这些按钮;然而,他们都最终动态加载Javascript,并在幕后创建自己的代码:

For example, you can use the methods described below to create these buttons dynamically; however they all end up loading Javascript dynamically and creating their own code behind the scenes:

  • http://developers.facebook.com/docs/reference/plugins/like/
  • http://twitter.com/about/resources/buttons
  • http://www.google.com/webmasters/+1/button/

推荐答案

以下链接将注册相应的赞助,推文和+1:

The following links will register the appropriate Likes, Tweets and +1s:

  • http://www.facebook.com/sharer.php?u=http://example.com
  • http://twitter.com/share?url=http://example.com&text=Description
  • https://plusone.google.com/_/+1/confirm?hl=en&url=http://example.com

这些链接适用于Wordpress:

These links will work for Wordpress:

<a href="http://www.facebook.com/sharer.php?u=<?php if(is_home()){echo home_url();}else{the_permalink();} ?>" target="_blank" title="Share this page on Facebook">Like</a>

Twitter

<a href="http://twitter.com/share?url=<?php if(is_home()){echo home_url();}else{the_permalink();} ?>&text=<?php the_title(); ?>" target="_blank" title="Tweet this page on Twitter">Tweet</a>

Google +1

<a href="https://plusone.google.com/_/+1/confirm?hl=en&url=<?php if(is_home()){echo home_url();}else{the_permalink();} ?>" target="_blank" title="Plus one this page on Google">+1</a>

这篇关于Facebook,Twitter和Google +1按钮仅使用HTML(无Javascript)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆