JS Window Object

Source: Internet
Author: User

The core object of the BOM is window, which represents an instance of the browser.

In the browser, the Window object is (1) an interface to access the browser window via JavaScript

(2) Global objects specified by ECMAScript

1. Global scope

ECMA-266 defines objects: Built-in objects (such as Object, Array, String, Function) and monolithic built-in objects (global and math)

In fact, there are no global variables and global functions; All properties and functions defined in the global scope are properties of global objects. In addition, all constructors of native reference types (like object, function) are also properties of global. All reference types inherit object by default.

Web browsers implement this global object as part of a Window object, so variables and functions declared in the global scope become properties and methods of the Window object.

2. Window relationship and framework

If the page contains frames, each frame has its own window object, which is saved in the Frames collection (the numeric index starts at 0, from left to right, top to bottom). Each Window object has a Name property that contains the names of the frames.

The top object always points to the highest (most outer) layer of the frame, which is the browser window.

For any code written in the framework, the window object points to a specific instance of that frame, not to the top-level frame.

The parent object always points to the immediate upper frame of the current frame.

JS Window Object

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.