Useful Javascript
grahams -
-
1 min read
Ok, Javascript sucks, but this use is kinda neat…. I have a bookmark created in Mozilla (but this code should work in IE) whose document location is set to:
javascript:q = document.getSelection(); if(!q) void(q=prompt('Dictionary:','')); if(q) location.href = 'http://www.m-w.com/cgi-bin/dictionary?' + escape(q)
If I highlight a word on whatever page I am looking at and then click on this bookmark, it looks that word up in the M-W Dictionary… If I don’t have any text selected, it instead prompts me for the word to look up.. I also have similar things to search IMDB…
I have had this for awhile and thought some of y’all would be interested…