Dynamic Pages With Javascript

Text chapters 13–16.

Javascript is another programming language which allows pages to respond to input from the user. Like PHP, Javascript code is added to an HTML page to create a mixture. Unlike PHP, Javascript runs on the client side, in the web browser. This makes it much more responsive, since it can react to user input without network roundtrip to the server.

When created, the main purpose of Javascript was to check the contents of forms before sending them to the server. This avoids a round trip to the server, saving the user time and reducing load on the server. But Javascript has expanded far beyond that over time. It can be used to interact with the user and implement any number of effects. In fact, full-blown applications can be written in Javascript.

Note: Javascript is not to be confused with Java. Java is a different computer language, with some similarity in appearance, but vastly different in semantics, implementation, execution environment and purpose.