Window object
1. Window Object
The Window object is the core of the bom, and the Window object refers to the current browser window
All JS global objects, functions, and variables automatically become members of the Window object
A global variable is a property of a Window object
A global function is a method of a Window object
Even document in the HTML DOM is one of the properties of the Window object
2. Window size (does not include toolbars and scroll Bars)
Window.innerheight the internal height of the browser window
window.innerwidth The interior width of the browser window
3. Window method:
Window.Open () opens a new window Window.close () close the current window
Timer
1. Timing Events: by using javascript, we have the ability to execute code after a set Interval. Instead of executing immediately after the function is called, we call it a timing event.
2, timing method: SetInterval () interval Specifies the number of milliseconds to execute the specified code clearinterval () stop setinterval () method to execute the function code
SetTimeout () suspends the specified number of milliseconds after execution of the specified code cleartimeout () stops execution of the setTimeout () Method's function code (self-tuning to loop down )
History Object
1. History Object: The Window.history object contains a collection of browser histories (urls)
2. History method: History.back () Same as clicking the Back button in the browser
History.forward () the same as clicking the Forward button in the browser
History.go () go to a page in history
Location Object
1. Location Object: Window.location object is used to get the address (URL) of the current page, and to relocate the browser to a new page
2. Properties of the location object:
Location.hostname returns the domain name of the web host
Location.pathname returns the path and file name of the current page
Location.port returns the port of the web host
Location.protocol returns the Web protocol used (http/| | | Https://)
The Location.herf property returns the URL of the current page
Location.assign () loading a new document
Screen Object
1. Screen object: Window.screen object contains information about user screens
2. Properties: screen.availwidth Available screen width
Screen.availheight the available screen height
Screen. Height screen Altitude
Screen. Width screen widths
JavaScript Browser Object