Although Javascript resembles Java, it is not the same as Java. Java is a more extensive and powerful, platform-independent programming language, often used to create applet programs which run in Netscape, but also capable of creating stand-alone programs. Javascript gives HTML authors control over Java applet programs. Java is compiled on the server, and the object code is passed to the client for execution; Javascript is interpreted by the client.
If you want to explore Javascript's full range of capabilities, you will do well to obtain a book on it from your local library of bookstore.