Reference: http://www.w3cschool.cc/js/js-window.html
Iv. Browser BOM
The browser object Model (BOM) gives JavaScript the ability to "talk" to the browser.
(1) Window
There is no formal standard for the browser object model (Browser).
All Browsers support window objects, which represent browser windows.
Even the document of the HTML DOM is one of the properties of the Window object: Window.document.getElementById ("header");d Ocument.getelementbyid ("header") ; var W=window.innerwidth | | Document.documentElement.clientWidth | | Document.body.clientwidth;var H=window.innerheight | | Document.documentElement.clientHeight | | Document.body.clientHeight;
window.open (); Open a new Window window.close (); Close the current window Window.moveto (); Move the current window Window.resizeto (); Adjust the current window
(2) Window screen
The Window.screen object contains information about the screen.
Screen.availwidth; Available screen width screen.availheight; Screen height available screens {availwidth:1366, availheight:738, width:1366, height:768, colordepth:24, pixeldepth:24, top:0, le ft:0, availtop:0, availleft:0}
(3) Window location
The Window.location object is used to obtain the address (URL) of the current page and redirect the browser to a new 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; Returns the port of the web host (80 or 443) Location.protocol; Returns the Web protocol used (HTTP///https://)
(4) Window history
Window.history object contains the history of the browser
JavaScript Learning (2-2)