You are here:   Articles > Internet Marketing
Register   |  Login

Internet Handholding Newsletter

Minimize

Articles

Minimize
21

Here is some code for adding both Google Plus One and Facebook Like Button to your website. You will need to change the code in one place below to replace "www.mydomain.com" with your domain name. Otherwise, you should be able to cut and paste.

<div style="margin-left:2em;">
<p>Please let others know about us.</p>
<table border="0" cellspacing="0">
<tr valign="middle">
<td>
<g:plusone size="medium"></g:plusone>
<!-- Place this render call where appropriate -->
<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>
</td>
<td>
<div id="fb-root"></div>
<script>
(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) {return;}
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
  }
(document, 'script', 'facebook-jssdk'));
</script>
<div class="fb-like"
 data-show-faces="true"
 data-width="450"
 data-send="true"
 data-href="www.mydomain.com"
 data-layout="button_count"></div>
</td>
</tr></table>
</div>

This code formats the Google Plus One and Facebook Like and Send buttons nicely on one line, using a TABLE tag, because the code here for Google Plus One uses its own line.

You can customize the code by going to the Facebook and Google customization pages.

Facebook Like Button
http://developers.facebook.com/docs/reference/plugins/like/

Google Plus One Button
http://www.google.com/webmasters/+1/button/

Post Rating

Comments

si
# si
Monday, March 19, 2012 6:59 PM
Thabks for that - worked a treat !

Post Comment

Name (required)

Email (required)

Website

Enter the code shown above in the box below

Internet and Computer Tips

Minimize



Internet Marketing Bookmark

Minimize

AddToAny.com AddThis.com