JS Window
Window objects: http://www.w3school.com.cn/js/js_window.asp
Window objects are supported by all browsers. It represents the browser window.
All JavaScript global objects, functions, and variables automatically become members of the Window object.
Properties and method formats for window objects:
[Window.] Property
[Window.] Method (Parameters)
Even the document of the HTML DOM is one of the properties of the Window object:
Window.document.getElementById ("header");
Same as this:
document.getElementById ("header");
JS Screen
Screen objects: http://www.w3school.com.cn/js/js_window_screen.asp
Screen objects mainly describe the display and color properties of the screen.
Properties of Screen objects:
Format: Screen. Properties
Screen.availwidth-Available Screen width
Screen.availheight-Available Screen heights
In pixels, subtract interface features, such as window taskbar.
JS Location
Location object: http://www.w3school.com.cn/js/js_window_location.asp
The location object is used to represent the URL information for a particular window.
The Window.location object does not use the prefix of window when writing.
Some examples:
Location.hostname returns the domain name of the web host
Location.pathname returns the path and filename of the current page
Location.port return to the web host's port (80 or 443)
Location.protocol returns the Web protocol used (http://or https://)
The Location.href property returns the URL of the current page.
The Location.assign () method loads the new document.
JS History
Historical objects: http://www.w3school.com.cn/js/js_window_history.asp
Historical objects are used to store lists of URLs that the client has recently visited.
To protect user privacy, there are restrictions on how JavaScript accesses the object.
Some methods:
History.back ()-Same as clicking the Back button in the browser
History.forward ()-Same as clicking the button in the browser forward
File objects
File objects: Represents the current HTML object, is composed of <body> tag group, each HTML file will automatically create a file object.
Format:
Document. Properties
Document. Method (Parameters)
Linked objects
The links in the Web page are automatically treated as linked objects and, in order, are represented as document.links[0],document.links[1] ...
Define the format of the linked object:
String. Link (properties)
Form objects
the child object of the file object, and the JavaScript runtime engine automatically creates a Form object for each form.
Format:
document.forms[index]. Properties
document.forms[index]. Method (Parameters)
Document. Name of the form. property
Document. Name of the form. Method (Parameters)