Created
September 17, 2010 08:37
-
-
Save roamlog/583929 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:var d=document,w=window,f='https://twitter.com/share',l=d.location,e=encodeURIComponent,c=w.getSelection?w.getSelection().toString():d.getSelection?d.getSelection():d.selection.createRange().text;p='?url='+e(l.href)+'&text='+ e(c?c:d.title);a=function(){if(!w.open(f+p,'Tweet Button','toolbar=0,status=0,resizable=0,width=550,height=400,left=200,top=200'))l.href=f+'.new'+p};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else{a()}void(0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@jinnli 昨天贴了段 twitter bookmarklet 的代码给我 (http://tinypaste.com/f4f30), 有那么一点点问题, 如果我选中了一段文本后,还是会提取页面的 title 到弹出页面的输入框中, 所以稍微修改了一下.