SUMMARY
The Browser Object Model (BOM) is based on the window
object, which represents the browser window and the viewable page area. The window
object doubles as the ECMAScript Global
object, so all global variables and functions become properties on it, and all native constructors and functions exist on it initially. This chapter discussed the following elements of the BOM:
- To reference other window objects, there are several window pointers.
- The
location
object allows programmatic access to the browser's navigation system. By setting properties, it's possible to change the browser's URL piece by piece or altogether. - The
replace()
method allows for navigating to a new URL and replacing the currently displayed page in the browser's history. - The
navigator
object provides information about the browser. The type of information provided depends largely on the browser being used, though some common properties, such asuserAgent
, are available in all browsers.
Two other...