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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.