Facebook/Twitter "Like" buttons in pure html
I'm trying to add share buttons to my simple website...
Is it possible to make a Facebook "like" button in pure html?
Is it possible to make a Twitter "like开发者_开发技巧" button in pure html?
From Facebook's developer documentation, insert the following into the body of your markup:
<iframe src="https://www.facebook.com/plugins/like.php?href=YOUR_URL"
scrolling="no" frameborder="0"
style="border:none; width:450px; height:80px"></iframe>
(make sure you close the iframe tag, on the facebook website it is left open.)
And for twitter (found on a forum):
<a href="https://twitter.com/home?status=Enter status message here"
title="Click to send this page to Twitter!" target="_blank">Tweet This!</a>
The Tweet Button is the recommend way for twitter, although a simple link like this works too, if you want to share a link:
- http://twitter.com/share?url=http://example.com&text=Some%20tweet%20text
Similar, http://www.facebook.com/sharer.php?u=
allows to share an URL as well.
There are probably more ways to share without using JavaScript (I remember some feature that preset the tweet text on the twitter homepage, but can't find it right now).
精彩评论