码迷,mamicode.com
首页 > 其他好文 > 详细

BOM Summary P268-P269

时间:2015-05-20 13:07:31      阅读:109      评论:0      收藏:0      [点我收藏+]

标签:

  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. 

BOM Summary P268-P269

标签:

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!