0. BOM vs. DOM Bom:browser object model, which is the absolute core of using JavaScript in the web;
BOM: Provides objects that interact with the browser window, independent of content. The BOM provides a number of objects (Windows, location, navigator) that are used to access the functionality of the browser, regardless of any Web content; Dom:document Object Model,dom is a tree based API for XML. Describes the methods and interfaces for dealing with Web content, which is the api,dom of HTML and XML to plan the entire page into a document composed of node hierarchies. The DOM itself is a language-independent API and is not bound to java,javascript or other languages.
1. Window Objects
Global scope: The Window object acts as a global object in ECMAScript, so all variables declared in the global scope and functions become properties and methods of the Window object.
var age =
Showage () {
alert (this.age)
}//
access Variable
alert (window.age)
in the global scope Showage ()
//accessing functions in the global scope
window.showage ()