BOM Summary P268-P269

  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 of it, and all native constructors and functions exist on it initially. This chapter discussed the following elements of the BOM:

  • When frames are used, each frame has its own window object and its own copies of all native constructors and functions. Each frame is stored in the frame collection, indexed both by position and by name.
  • To reference other frames, including parent frames, there are several window pointers.
  • The top object always points to the outermost frame, which represents the entire browser window.
  • The parent object represents the containing frame, and self points back to window.
  • 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 as userAgent, are available in all browsers.

  Two other objects available in the BOM perform very limited functions. The screen object provides the information about the client display. This information is typically used in metrics gathering for web sites. The history object offers a limited peek into the browser's history stack, allowing developers to determine how many sites are in the history stack and giving them the ability to go back or forward to any page in the history. 

原文地址:https://www.cnblogs.com/linxd/p/4516748.html