CROSS BROWSER GETSELECTION BOOKMARKLET


/ Published in: JavaScript
Save to your folder(s)

Passes variables for url and highlighted text.


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.