- Friday, July 22, 2011 - 0 comments
Add Google +1 button to any site in 4 easy steps with a bookmarklet
Here is a very quick trick to add the Google +1 button to any site you visit by using a bookmarklet.
So far I have tested it on Firefox and Chrome without problem.
1. Copy the following code
javascript:function go(){var d=document;if(window.top==window.self){var oH=d.getElementsByTagName('HEAD').item(0);var oS=d.createElement("script");oS.type="text/javascript";oS.src="https://apis.google.com/js/plusone.js";oH.appendChild(oS);var oB=d.getElementsByTagName('body').item(0);var oBu=d.createElement("div");var oBuS=oBu.style;oBuS.position="fixed";oBuS.zIndex="10000";oBuS.top="25px";oBuS.left="15px";oBu.innerHTML="<g:plusone></g:plusone>";oB.appendChild(oBu);}}go();
2. Manually add a new bookmark
In Firefox, you can do that either via the bookmark manager (Bookmarks -> Organize bookmarks->Bookmark toolbar) or by right clicking on the bookmark toolbar (make sure 'load in sidebar' is unchecked).
In Chrome, the fastest way is to add any page as a bookmark and click 'edit' when the confirmation pop-up comes out.
3. Paste the code in the 'location' field (Firefox) or 'URL' field (Chrome)
4. Give it a siny name and save the bookmark
Now any time you click on this bookmark, the +1 button will appear on the top left corner of your page.
Note: This post is a follow up to my previous post "Add Google +1 button to any site with this GreaseMonkey script".


0 Responses to "Add Google +1 button to any site in 4 easy steps with a bookmarklet"
Post a Comment
Tell me how much you hate it.