JavaScript in the Web Page

Robert Jeansoulin · 2018

This chapter focuses on Document Object Model (DOM). The HTML DOM is a tree: a root, followed by child nodes, recursively up to terminal nodes, empty-tags or text-nodes. The layout engine builds the tree while parsing the HTML document step by step in “depth-first” mode. The link between a DOM element and a CSS rule is established through the CSS selectors: a similar link can be established from JavaScript. JavaScript can also handle the CSS rules linked to a specific DOM element. When loading the page in the browser, several objects are created and stored in a tree structure called the “Browser Object Model” (BOM). The chapter lists a selection of useful properties and methods, for data-oriented purposes, grouped by functionality. There are several kinds of events in the ecosystem of the web page. Each browser window runs only one process: the “event loop”, which successively, and sequentially, executes the tasks.

Read the paper · More papers on PaperTik