Login  Register

Re: Learning JavaScript

Posted by dscho on Aug 11, 2010; 7:05am
URL: http://imagej.273.s1.nabble.com/Learning-JavaScript-tp3687295p3687296.html

Hi David,

On Tue, 10 Aug 2010, David Webster wrote:

> I have been trying to teach myself JavaScript by writing code embedded
> in html and then loading that in Moszilla Firefox 3.6.8. But, I can't
> get it to understand importPackage(java.awt). I just get an error
> message that says "Error: importPackage is not defined". Does anyone
> know what the problem coud be? The html is included below.

There is quite some difference between Javascript as used in HTML than as
it is used in ImageJ. Not syntax-wise, but the way it is used.

As it happens, we have a very nice introduction on the Fiji Wiki:

        http://pacific.mpi-cbg.de/Javascript_Scripting

It assumes that you have basic knowledge of macro programming, though, as
it does not explain constructs such as conditionals or loops.

Ciao,
Johannes