Posted By

vagrantradio on 02/16/10


Tagged

javascript link bookmarklet getSelection


Versions (?)

CROSS BROWSER GETSELECTION BOOKMARKLET


 / Published in: JavaScript
 

Passes variables for url and highlighted text.

  1. javascript:(function(){if(window.getSelection){t=window.getSelection();}else%20if(document.getSelection){t=document.getSelection();}else%20if(document.selection){t=document.selection.createRange().text;};location.href='http://www.yourdomain.com/?&u='+encodeURIComponent(location.href)+'&t='+t;})();

Report this snippet  

You need to login to post a comment.