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