Chapter 16. Introduction to Events

A web application is usually divided into two distinct parts. The first is usually referred to as the back end or server side. It is powered by PHP, ASP.NET, Ruby, or any other server-side technology to validate, process, and format data. While there's always some level of complexity involved with an application, the server-side portion of a web application is typically more straightforward than the client portion — the second part — because it has to do something only when data is sent or requested by the user.

The client portion, or front end, is the interface used by the user to input and view information, as well as to interact with the application as a whole. The client portion is made up of HTML, CSS, and JavaScript. HTML and CSS are sufficient for providing a user interface for a web application, but JavaScript is what can make an interface dynamic and responsive.

The user interface of a web application is usually in a reactive state — it waits for the user to perform a particular action before it knows to do something. Look at Google's search page as an example. When you first visit the page, you see something similar to Figure 16-1.

You see nothing but a search form, but the moment you move your mouse pointer or type in the search field, the page reacts to your actions. Moving your mouse causes the tool bar at the top to fade into view, and typing text into the search field causes Google's autocomplete feature to activate, as shown in Figure ...

Get JavaScript® 24-Hour Trainer now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.