Window-Timer
1?settimeout () can be used to invoke a function one time after a specified time.
setTimeount(f,1000);//一秒后调用函数fclearTimeout();取消函数的执行
2. SetInterval () can be used to repeat the call function after the specified time.
setInterval(f,1000);//每1秒调用函数fclearInterval();取消函数的调用
window-location (positioning)
The Location Property object of the 1?window object, which represents the URL of the document currently displayed in the window, or it can be loaded into a new document.
The location of the 2?document object is the same as the location of the Window object.
3. Common Properties:
- Location.href: Returns the URL of the current page
- Location.hostname: Returns the domain name of the web host
- Location.pathname: Returns the path and file name of the current page
- Location.port back to Web: Host port
- Location.protocol: Returns the Web protocol used (/HTTP///https://)
window-Browsing history
1. The History property of the Window object is used as a list of the browser's historical documents.
- Window.history.length: Represents the number of elements in the browsing history table.
- Window.history.back (): the same as the browser's Back button.
- Window.history.forward (): Same as the "forward" button in the browser.
- Window.history.go (): Accepts an integer parameter that can skip any number of pages forward (positive) or backward (negative arguments).
Window-navigator Object
1. We need to know that the current browser vendor and version information can be used with the Navigator object. It has several common properties.
- AppName: The full name of the browser.
- AppVersion: The version of the browser.
- UserAgent: usually contains the string sent in the HTTP header, or it may contain other details.
2. You can also use non-normalized properties.
- Online: Indicates whether the browser is currently connected to a network.
- Gelocation: Properties for determining user geolocation information, HTML5
- javaenabled (): Returns True when the browser runs a Java applet.
- Cookieenable: Returns True when the browser can save the cookie.
window.navigator.appName
Day02--widow Object