JS Knowledge complement

Source: Internet
Author: User

1. Attributes contained by the Window.location object

Properties Description
Hash URL (anchor) starting with pound sign (#)
Host Host name and port number of the current URL
Hostname Host name of the current URL
Href The full URL
Pathname The path portion of the current URL
Port Port number of the current URL
Protocol Protocol for the current URL
Search URL starting from question mark (?) (Query section)

2, JS in the window.parent, Window.top,window.self detailed

The parent is the parents window, top is the top-most parent window, and self is the current window, and opener is the window that opens the current window with the open method.

Window.self: is a reference to the current window itself. It is equivalent to the window, self property.

Window.top: Returns to the top-level window, which is the browser window. Returns the topmost browser window of the current window.

Window.parent: Returns the parent window. If the window itself is a top-level window, the Parent property returns a reference to itself.

In a frames page, the normal parent window is the top-level window, but if there is a frame in the frame, the parent window and the top-level window are not necessarily the same.

Window.opener refers to the window that invokes the Window.Open method.

The hierarchy relationship of the Window object, the parent object, the frame object, the Document object, and the Form object.
The Window object →parent object →frame Object →document object →form object.
as follows: Parent.frame.document.forms[0].elements[0].value.

3. Popup child window
window.showModalDialog (URL, window);
Then in the popup subwindow:
Window.dialogarguments is a reference to the Window object of the parent Windows ReturnValue is a property of the HTML window object in JavaScript to return the window value when using the
The window.showModalDialog function opens a mode window for IE, which is used to return the value of the window when it is open and cannot manipulate the parent window, only when the modal window is closed.

JS Knowledge complement

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.