Re: "Iconoclastic"? - stupid web tricks...

Date view Thread view Subject view Author view

From: Kragen Sitaker (kragen@pobox.com)
Date: Tue Nov 14 2000 - 14:22:45 PST


Willem Broekema writes:
> Erik F. Kastner wrote:
> > heres what I use when I don't know a word (IE 4+ only)
> > make a file in
> [snip]
> > then just highlight, and right click on a word you don't know, go to "Word
> > Lookup" and viola!
>
> A bookmarklet with url
>
> javascript:q=document.getSelection();if(!q){void(q=prompt('Word...',''))};if(q)location.href='http://www.m-w.com/cgi-bin/dictionary?book=Dictionary&va='+escape(q)
>
> gives about the same functionality, FWIW.

Here's a dict.org version, without the prompt:

<a href="javascript:location='http://www.dict.org/bin/Dict?Strategy=*&Database=*&Form=Dict1&Query='+escape(document.getSelection())">Lookup</a>

Here's a version that pops up windows from dict.org, m-w.com, and
dictionary.com:

<a href="javascript:q=escape(document.getSelection());void window.open('http://www.dict.org/bin/Dict?Strategy=*&Database=*&Form=Dict1&Query='+q);void window.open('http://www.m-w.com/cgi-bin/dictionary?book=Dictionary&va='+q);void window.open('http://www.dictionary.com/cgi-bin/dict.pl?term='+q)/*kjs*/">Lookup</a> another word in a new window

Unfortunately, these are Netscape-only; I should go ahead and figure
out how to document.getSelection() in MSIE.

-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Perilous to all of us are the devices of an art deeper than we ourselves
possess.
                -- Gandalf the Grey [J.R.R. Tolkien, "Lord of the Rings"]


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Fri Nov 17 2000 - 18:22:22 PST