Type in a command, or "ls dictionary" to search all commands for "dictionary", etc.

qdef

(This command has been awarded a Yubnub Golden Egg)

echo <script>def=window.open('http://www.ninjawords.com/%s');setTimeout("def.close();history.go(-1);",${t=10}000);</script>
NAME
     qdef - Quick Definitions -- get a definition from ninjawords.com in a self-closing window.

SYNOPSIS
     qdef [WORD] -t [OPTIONAL SECONDS]

EXAMPLES
     qdef polysemy
       << pops open a window with the definition for "polysemy".  It automatically closes in 10 seconds.
     
     qdef polysemy -t 20
       << the same as before, but it waits 20 seconds before closing

DESCRIPTION
     This command loads definitions from the excellent ninjawords.com.
     It automatically closes the definition window in 10 seconds.
     To change the length that the window is open, use the -t parameter.

NOTES
     Your browser must be set to allow pop-ups from yubnub.org"

     The technique this command uses is a short javascript program with a setTimeout event. A YubNub echo command just loads the javascript onto a webpage.
     
     Here is the javascript:
     
     <script>
     def=window.open('http://www.ninjawords.com/%s');  /* opens the ninjawords page under the variable 'def' */
     setTimeout("def.close()",${t=10}000);  /* sets a timer to close 'def' using a default of 10 seconds (10,000 ms) */
     history.go(-1);  /* returns you to your original page */
     </script>
     
     This technique could be easily used for any YubNub command that loads a window you only need to view briefly.
     

AUTHOR
     Brian Armknecht
     
     
     b.a.
    
1056 uses - Created 2006-12-13 22:55:25 - Last used 2023-07-22 23:13:27
Is this command broken? Tell Jon if you know how to fix it.