9.2 window Object
In the previous chapter, you learned about the document object model (DOM), which uses the document object as the root node of the DOM’s node tree. The node tree contains objects for each entity within a web page—elements, attributes, and plain text. You can use JavaScript with the DOM’s objects to manipulate the elements, attributes, and plain text in a web page. Usually, as a JavaScript programmer, all you’ll need to access are the things within the current web page. But sometimes there’s a need to access the window that contains the web page. To do that, you can use the window object.
When you launch a browser (e.g., when you double click the Chrome icon on your desktop), or you launch a new tab within a browser window, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access