Chapter 9

Controlling the Browser with the Window Object

IN THIS CHAPTER

Bullet Understanding the BOM (Browser Object Model)

Bullet Opening and closing windows

Bullet Getting windows properties

Bullet Resizing windows

“In making theories, always keep a window open so that you can throw one out if necessary.”

— BELA LUGOSI

The Browser Object Model (BOM) allows JavaScript to interact with the functionality of the web browser. Using the BOM, you can create and resize windows, display alert messages, and change the current page being displayed in the browser.

In this chapter, you discover what can be done with the browser window and how to use it to write better JavaScript programs.

Understanding the Browser Environment

Web browsers are complicated pieces of software. When they work well, they operate seamlessly and integrate all their functions into a smooth and seemingly simple web browsing experience. We all know that web browsers have an occasional hiccup and sometimes even crash. To understand why this happens, and to be able to make better use of browsers, it’s important to know the many different parts ...

Get Coding All-in-One For Dummies, 2nd Edition 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.