50

image Lookup the Online Dictionary from a Web Page

This is a JavaScript bookmarklet that takes a word that is selected within the current page and looks it up on Dictionary.com. You need to collapse it down to this form and insert it in your web browser.

javascript: i=window.getSelection();if(!i){ void(i=prompt(’Word…’,’’))}; if(i) { void(window.open(  ‘http://www.dictionary.com/cgi-bin/dict.pl?db=*&term=’+escape(i), ‘_blank’,’’)) }

This is what the code looks like in a more human-readable form (line breaks added to help readability):

javascript:i=window.getSelection(); if(!i){ void(i=prompt(’Word…’,’’))};  if(i) {  void(window.open(   ‘http://www.dictionary.com/cgi-bin/dict.pl?db=*&term=’+escape(i), ...

Get Developing Quality Metadata now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.