Skip to content

Instantly share code, notes, and snippets.

@luokebi
Created October 15, 2013 02:36
Show Gist options
  • Save luokebi/6985679 to your computer and use it in GitHub Desktop.
Save luokebi/6985679 to your computer and use it in GitHub Desktop.
social network share button
Facebook
--------
<a title="send to Facebook"
href="http://www.facebook.com/sharer.php?s=100&p[title]=YOUR_TITLE&p[summary]=YOUR_SUMMARY&p[url]=YOUR_URL&p[images][0]=YOUR_IMAGE_TO_SHARE_OBJECT"
target="_blank">
<span>
<img width="14" height="14" src="'icons/fb.gif" alt="Facebook" /> Facebook
</span>
</a>
<a class="facebook" target="_blank" onclick="return !window.open(this.href, 'Facebook', 'width=640,height=300')" href="http://www.facebook.com/sharer/sharer.php?u=YOUR_URL">Facebook</a>
Twitter
--------
This can be solved by using http://twitter.com/intent/tweet instead of http://www.twitter.com/share. Using the intent/tweet function, you simply URL encode your entire URL and it works like a charm.
http://dev.twitter.com/pages/intents
Goolge+
-------
<a href="https://plus.google.com/share?url={URL}" onclick="javascript:window.open(this.href,
'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><img
src="https://www.gstatic.com/images/icons/gplus-64.png" alt="Share on Google+"/></a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment