Chapter 2. Context

JavaScript is used in the context of a Web page. This is obvious, but it has a few consequences that haven’t always been properly appreciated. JavaScript is embedded in an environment that also uses HTML and CSS, and in which usability and accessibility are essential elements. After all, a script must add something useful to a site, and the site must continue to work when JavaScript is disabled or entirely absent.

This chapter—in fact, my entire approach to JavaScript programming—is heavily influenced by the standards-compliance CSS revolution that has changed Web development. Therefore it’s fitting to start this chapter with a quick summary of the CSS revolution and its impact on JavaScript.

A. The CSS revolution

As we saw ...

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.