Google +1 Button using Javascript

The easiest method for including google +1 button on your web page is to include the necessary JavaScript resource and to add a +1 button tag.

Just add below tag into your HTML where you want to put google +1 button.

<!-- Place this tag where you want the +1 button to render. -->
<div class="g-plusone"></div>

Add below java script into your head section.

<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>

That’s it.
You can find all other parameters at https://developers.google.com/+/plugins/+1button/

About these ads

1 Comment

I like to hear from you about this !!

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s