1 Window Object
It is an interface that accesses the browser window via JS, and is also the global object specified by ECMAScript.
1.1 Global scope
Global variables cannot be deleted through delete, but the properties defined directly on the Window object can be
var == "Red"; delete window.age; // throws an error while ie<9, and returns false in other browsers Delete // throws an error when ie<9, returns true in other browsers alert (window.age); // in // undefined
Because the Window property added with the VAR statement has an attribute named [[Configurable]], the reference to this attribute is set to false, so it cannot be deleted through delete.
* Attempting to access an undeclared variable throws an error, but through window you can query whether a variable exists
1.2 Window relationships and frames (never used, usually with jquery or other frameworks)
1.3 Window Position (IBID.)
1.4 Window Size (IBID.)
1.5 Navigating and opening windows
window.open ()-Four parameters: the URL to load, the window target, an attribute string, and a Boolean value that indicates whether the new page supersedes the page currently loaded by the browser.
* Handling when blocked
var false ; Try { var wroxwin = window.open ("", "_blank"); if NULL ) { true; }} Catch (ex) { true;} if (blocked) { alert ("The Popup was blocked!" );}
1.6 Intermittent calls and timeout calls
It is not recommended to use a string as the first argument
The second parameter is defined by telling JS how long it takes to add the current task to the queue instead of executing it.
* In strict mode, this is undefined.
1.7 System dialog box (alert, confirm, prompt)
2 Location Object
Provides information about the documents loaded in the current window, as well as some navigational features. Window.location and Document.location refer to the same object.
2.1 Query string parameters
2.2 Position operation
3 Navigator Objects
3.1 Detection Plug-in
3.2 Processing the registration procedure
4 Screen Object
5. History Object
// back one page history.go ( -1); History.back (); // forward one page history.go (1); History.forward (); // jump to the nearest wrox.com page history.go ("wrox.com")
JavaScript Browser object Model (BOM)