I wasted a lot of time last night searching for JavaScript documentation. My friend Scott Flinn was nice enough to give me these pointers regarding DOM and general Web work:

This is much better than flying blind, but I wish I had something more like the Java API documentation.

BTW if you don’t know Scott Flinn, you should. He is probably the best technical resource I ever met. And I don’t mean “technical resource” in an insulting way. He simply understands hands-on technology very deeply. He is also a pessimist like myself, so we do get along, I think.

Here’s some advice from Scott:

If you just want core JavaScript stuff, then you use Rhino or
SpiderMonkey (the Mozilla implementations in Java and C++ respectively).
I swear by Rhino. You just drop js.jar into your extensions directory
and add this simple script to your path:

#!/bin/sh
java org.mozilla.javascript.tools.shell.Main

Then ‘rhino’ will give you a command line prompt that will evaluate
arbitrary JavaScript expressions. The nice part is that you have
a bridge to Java, so you can do things like:

js> sb = new java.lang.StringBuffer( ‘This’ );
This
js> sb.append( ‘ works!’ );
This works!
js> sb
This works!

What I did was to download Rhino, open the archive, and type “java -jar js.jar”. It brought up a console. System.out doesn’t work, but you can print using the “print” command. (Update:Obviously, you have to do java.lang.System.out…)

No Comments »

No comments yet.

Leave a comment

Warning: When entering a long comment, please ensure that you make copy of your text prior to submitting it. If the server should fail or if you hit a bug, you might lose your work. I am not responsible for your lost effort.

To spammers: I carefully review every single post and make sure that spam gets deleted. You are wasting your time if you are manually entering spam using this form. Read my terms of use to see what I consider to be abusive.

Example: duo plus septem is '9'. The numbers are expressed in latin numerals but you should give your answers using ordinary digits.

 

« Blog's main page

Powered by WordPress