Useful Javascript

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…

13 thoughts on “Useful Javascript

  1. works wonderfully in Mozilla but IE says that the protocol javascript does not have a registered applications … hmmm… any idea? Because I really like it I have to say.

    Oliver aka BizKiffer

    1. works wonderfully in Mozilla but IE says that the protocol javascript does not have a registered applications … hmmm… any idea? Because I really like it I have to say.

      I think you are SOL on this one… I never, ever use IE, so I have no idea what it would take to make it work… My solution? Ditch that crappy browser. :)

Leave a Reply to bizkifferCancel reply