JSFiddle - React, Tailwind, and code Playground

by kobi

HTML

Button:
<br />
<a href="javascript:var%20d=document,w=window,f='http://hootsuite.com/twitter/bookmark-tool-v2?',l=d.location,e=encodeURIComponent,s1=w.getSelection,s2=d.getSelection,s3=d.selection,s=(s1?s1():(s2)?s2():(s3?s3.createRange().text:0)),s4=((s.toString()=='')?s:(' '+s+' ')),p='address='+e(l.href)+'&title='+e(s4||d.title),u=f+p;a=function()%7Bif(!w.open(u))l.href=u;%7D;if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();void(0);">ow.ly</a> - selected text instead of page title
<br />
<a href="javascript:var%20d=document,w=window,f='http://hootsuite.com/twitter/bookmark-tool-v2?',l=d.location,e=encodeURIComponent,s1=w.getSelection,s2=d.getSelection,s3=d.selection,s=(s1?s1():(s2)?s2():(s3?s3.createRange().text:0)),s4=((s.toString()=='')?s:(' '+s+' ')),p='address='+e(l.href)+'&title='+e(d.title+' '+s4),u=f+p;a=function()%7Bif(!w.open(u))l.href=u;%7D;if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();void(0);">ow.ly</a> - selected text after title