Chapter 2. Building the page at runtime

This chapter covers

  • Steps in the lifecycle of a web application
  • Processing HTML code to produce a web page
  • Order of executing JavaScript code
  • Achieving interactivity with events
  • The event loop

Our exploration of JavaScript is performed in the context of client-side web applications and the browser as the engine that executes JavaScript code. In order to have a strong base from which to continue exploring JavaScript as a language and the browser as a platform, first we have to understand the complete web application lifecycle, and especially how our JavaScript code fits into this lifecycle.

In this chapter, we’ll thoroughly explore the lifecycle of client-side web applications from the moment the page ...

Get Secrets of the JavaScript Ninja, Second Edition 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.