Snippets

Barry Smith Social Share Button / Browser bookmark share

Created by Barry Smith
1
2
3
4
5
6
7
8
9
// Facebook
javascript:var d=document,f='http://www.facebook.com/share',l=d.location,e=encodeURIComponent,p='.php?src=bm&v=4&i=1243972139&u='+e(l.href)+'&t='+e(d.title);1;try{if (!/^(.*\.)?facebook\.[^.]*$/.test(l.host))throw(0);share_internal_bookmarklet(p)}catch(z) {a=function() {if (!window.open(f+'r'+p,'sharer','toolbar=0,status=0,resizable=1,width=626,height=436'))l.href=f+p};if (/Firefox/.test(navigator.userAgent))setTimeout(a,0);else{a()}}void(0)

// Google+
javascript:void(window.open('https://plus.google.com/share?ur\l='+encodeURIComponent(location), 'Share to Google+','width=600,height=460,menubar=no,location=no,status=no'));

// Twitter
javascript:void(window.open('https://twitter.com/share?url='+escape(window.location.href)+'&text='+document.title, '', 'width=600,height=460,menubar=no,location=no,status=no'));

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.