JavaScript Window object

Source: Internet
Author: User

What is the relationship between window and window in JavaScript?

Https://zhidao.baidu.com/question/1896482748628552420.html

The Window object in the Avascript represents the windows that are open in the browser.
If the document contains a frame (frame or iframe label), the browser creates a Window object for the HTML document and creates an additional window object for each frame.
Note: There is no public standard applied to the Window object, but this object is supported by all browsers.
The actual window is a Windows, such as Windows window operation is a windowed.

It does not matter

The BOM is the browser window object model, the top object is window

Window,document are an instance object, they are all objects, you cannot be in new and must call his methods and properties directly

There are seven properties for the Window object:

    1. Defaulestatus: Specifies the information in the window status bar.

    2. Status: Specifies the information in the current window's status bar.

    3. Frames: is an array in which the contents are all frames in the window.

    4. Parent: Refers to the parents window of the current window.

    5. Self: Refers to the current window.

    6. Top: Represents the topmost window of all current Windows.

Windows: Represents the current window.

There are five methods of the Window object:

    1. Alert: Displays a dialog box with a OK button.

    2. Confirm: Displays a dialog box with "OK" and "Cancel" two buttons.

    3. Prompt: Displays a dialog box with an input area.

    4. Open: Opens a new window.

    5. Close: Closes the window that the user opened.

The window and document are not normally used.
But it's not that window will always have only one instance of window, and document will always have only one instance of document. For example, you can access the window and document in <iframe>. Again, for example, XMLHttpRequest's Responsexml property returns an instance of document.

JavaScript 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.