O'Reilly logo

Web Programming with HTML5, CSS, and JavaScript by Dean

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required