Unfortunately it's a little more complicated than that...
Javascript can be run on servers that support it. ASP pages can use javascript instead of vbscript.
The
Apache Sling server supports ESP (Ecma Script Pages) which are basically JSP's that use Javascript instead of Java. Any J2EE container can use server side javascript by including the
Rhino library. Actually, by using that library, any java program can include Javascript support (client, server, whatever).
On linux you can build desktop applications using
DCOP and Javascript. On Windows, you can do something similar in
HTAs. In both of these cases, javascript gets access to the filesystem, network, and various system internals.
PHP doesn't only have to be used on the server. Many people are now building
PHP desktop applications. I think it's crazy but, that's another matter.
A quick
search will give you lots of info on that.
Basically these are just different
dynamic loosely-typed
scripting languages. Tripy pointed out the primary ways you will see them in the web world. If you are learning, get started with Javascript first. It's a natural next step from HTML. The best thing with learning it, you don't need any tools or setup. Your web browser is your runtime engine, and text editor, your development tool.
Writing server code can be your next step after javascript.