Skip to content

Instantly share code, notes, and snippets.

@bryanwongbh
Created December 18, 2012 14:04
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/4328244 to your computer and use it in GitHub Desktop.
Save bryanwongbh/4328244 to your computer and use it in GitHub Desktop.
Javascript: Google +1 button
<!-- Google +1 button -->
<!-- Place this tag where you want the +1 button to render. -->
<div class="g-plusone" data-size="medium" data-href="<%= post_url %>"></div>
<!-- Place this tag after the last +1 button tag. -->
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment