9. Browsers and Windows

You learned in previous chapters that window is the global object in client-side JavaScript. Many of its properties and methods are part of the core JavaScript language, but it also has many other that are specific to programming in the browser. This chapter gives a quick overview and reference of the properties and methods that directly relate to browsers and browser windows.

Properties

Browser windows have a couple of properties that mostly deal with the size and position of the window on the screen. These properties are read-only, and you’ll need to use the window methods described in the next sections to change their values.

innerHeight, innerWidth Represent the pixel values of the size of the browser viewport. ...

Get The JavaScript PocketGuide 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.