Skip to content

Instantly share code, notes, and snippets.

@bryanwongbh
Created December 18, 2012 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bryanwongbh/4328255 to your computer and use it in GitHub Desktop.
Save bryanwongbh/4328255 to your computer and use it in GitHub Desktop.
Javascript: Twitter tweet button
<!-- Twitter tweet button javascript -->
<a href="https://twitter.com/share" class="twitter-share-button" data-url="<%= post_url %>" data-via="bryanwbh" data-related="bryanwbh" data-hashtags="blog">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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment