Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chitchcock/5903510 to your computer and use it in GitHub Desktop.
Save chitchcock/5903510 to your computer and use it in GitHub Desktop.
(function(){
var idToSearch=window.getSelection ?
window.getSelection().toString() :
document.selection.createRange().text;
if (idToSearch=== "") {
t = prompt("Enter ID","");
}
if (idToSearch) {
window.location='https://someurl.com/page.html?id='+idToSearch;
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment