Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'sends 'null' on cancel' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
sends 'null' on cancel
Authored by: rgray on Jul 22, '03 08:09:40PM

Love this tip, but..... ;-}

If I hit cancel instead of sending a word for look up in the Meriam-Webster version of this tip, the dialogue does not cancel! In fact it sends 'null'!.. and returns a definition of null.

How can I make 'cancel' cancel?



[ Reply to This | # ]
sends 'null' on cancel
Authored by: firthy374 on Jul 23, '03 02:42:58PM
This should work:

javascript:x=escape(getSelection());if(!x)%7Bvoid(x=prompt('Merriam-Webster%20Dictionary%20search:',''))%7D;
if(x!=null)%7Bwindow.location='http://www.m-w.com/cgi-bin/dictionary?book=dictionary&va='+x%7D


[ Reply to This | # ]
sends 'null' on cancel
Authored by: jpoage on Apr 27, '05 05:52:26PM

How would you get this to open in a new window, instead of the current window? Is that even possible? I tried using the "window.open" command, but I'm not smart ... :)



[ Reply to This | # ]