JavaScript is not Java !!! It is a scripting language that looks like Java, but is quite different in other aspects.
As it is a scripting language, it has to be interpreted line by line, and thus it is rather slow in execution. JavaScript is often used where Java is overkill, so for relative simple tasks. Some JavaScripts however are really jewels.
JavaScripts have the advantage that they load very quickly, but are limited in functionality.

For the developer, the disadvantage of JavaScript is that it is difficult to test, as error messages are usually cumbersome, and there is no good debugging mechanism. An advantage of developing in JavaScript however is that there is a huge amount of source code available on the internet.

This frame was opened and centered on your screen using JavaScript

Computer Chemistry Consultancy, June 2001