Chapter 1. Purpose

The purpose of JavaScript is to add an extra layer of usability to a Web page.

That sounds simple, but this golden rule has frequently been misunderstood. Not all scripts add usability to a Web site; in fact, during several periods of JavaScript’s checkered history, the creation of flashy-looking but useless scripts has been a significant cottage industry.

Even when writing useful scripts, JavaScript developers haven’t always written them in their proper context: that of an accessible, modern HTML page that integrates the insights of the Web standards movement.

Worse, some scripts don’t add a usability layer, they are the entire usability layer—and as a consequence the site falls apart when a browser doesn’t support JavaScript. ...

Get ppk on JavaScript 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.