(window.webpackJsonp=window.webpackJsonp||[]).push([[1712],{2120:function(t,e,o){"use strict";o.r(e);var r=o(31),n=Object(r.a)({},(function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[o("h1",{attrs:{id:"bom-browser-object-model"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#bom-browser-object-model"}},[t._v("#")]),t._v(" BOM (Browser Object Model)")]),t._v(" "),o("h2",{attrs:{id:"introduction"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#introduction"}},[t._v("#")]),t._v(" Introduction")]),t._v(" "),o("p",[t._v("The BOM (Browser Object Model) contains objects that represent the current browser window and components; objects that model things like "),o("strong",[t._v("history, device's screen,")]),t._v(" etc")]),t._v(" "),o("p",[t._v("The topmost object in BOM is the "),o("code",[t._v("window")]),t._v(" object, which represents the current browser window or tab. "),o("a",{attrs:{href:"http://i.stack.imgur.com/aC4OH.png",target:"_blank",rel:"noopener noreferrer"}},[o("img",{attrs:{src:"http://i.stack.imgur.com/aC4OH.png",alt:"enter image description here"}}),o("OutboundLink")],1)]),t._v(" "),o("ul",[o("li",[o("strong",[t._v("Document:")]),t._v(" represents current web page.")]),t._v(" "),o("li",[o("strong",[t._v("History:")]),t._v(" represents pages in browser history.")]),t._v(" "),o("li",[o("strong",[t._v("Location:")]),t._v(" represents URL of current page.")]),t._v(" "),o("li",[o("strong",[t._v("Navigator:")]),t._v(" represents information about browser.")]),t._v(" "),o("li",[o("strong",[t._v("Screen:")]),t._v(" represents device's display information.")])]),t._v(" "),o("h2",{attrs:{id:"window-object-methods"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#window-object-methods"}},[t._v("#")]),t._v(" Window Object Methods")]),t._v(" "),o("p",[t._v("The most important object in the "),o("code",[t._v("Browser Object Model")]),t._v(" is the window object. It helps in accessing information about the browser and its components. To access these features, it has various methods and properties.")]),t._v(" "),o("table",[o("thead",[o("tr",[o("th",[t._v("Method")]),t._v(" "),o("th",[t._v("Description")])])]),t._v(" "),o("tbody",[o("tr",[o("td",[t._v("window.alert()")]),t._v(" "),o("td",[t._v("Creates dialog box with message and an OK button")])]),t._v(" "),o("tr",[o("td",[t._v("window.blur()")]),t._v(" "),o("td",[t._v("Remove focus from window")])]),t._v(" "),o("tr",[o("td",[t._v("window.close()")]),t._v(" "),o("td",[t._v("Closes a browser window")])]),t._v(" "),o("tr",[o("td",[t._v("window.confirm()")]),t._v(" "),o("td",[t._v("Creates dialog box with message, an OK button and a cancel button")])]),t._v(" "),o("tr",[o("td",[t._v("window.getComputedStyle()")]),t._v(" "),o("td",[t._v("Get CSS styles applied to an element")])]),t._v(" "),o("tr",[o("td",[t._v("window.moveTo(x,y)")]),t._v(" "),o("td",[t._v("Move a window's left and top edge to supplied coordinates")])]),t._v(" "),o("tr",[o("td",[t._v("window.open()")]),t._v(" "),o("td",[t._v("Opens new browser window with URL specified as parameter")])]),t._v(" "),o("tr",[o("td",[t._v("window.print()")]),t._v(" "),o("td",[t._v("Tells browser that user wants to print contents of current page")])]),t._v(" "),o("tr",[o("td",[t._v("window.prompt()")]),t._v(" "),o("td",[t._v("Creates dialog box for retrieving user input")])]),t._v(" "),o("tr",[o("td",[t._v("window.scrollBy()")]),t._v(" "),o("td",[t._v("Scrolls the document by the specified number of pixels")])]),t._v(" "),o("tr",[o("td",[t._v("window.scrollTo()")]),t._v(" "),o("td",[t._v("Scrolls the document to the specified coordinates")])]),t._v(" "),o("tr",[o("td",[t._v("window.setInterval()")]),t._v(" "),o("td",[t._v("Do something repeatedly at specified intervals")])]),t._v(" "),o("tr",[o("td",[t._v("window.setTimeout()")]),t._v(" "),o("td",[t._v("Do something after a specified amount of time")])]),t._v(" "),o("tr",[o("td",[t._v("window.stop()")]),t._v(" "),o("td",[t._v("Stop window from loading")])])])]),t._v(" "),o("h2",{attrs:{id:"window-object-properties"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#window-object-properties"}},[t._v("#")]),t._v(" Window Object Properties")]),t._v(" "),o("p",[t._v("The Window Object contains the following properties.")]),t._v(" "),o("table",[o("thead",[o("tr",[o("th",[t._v("Property")]),t._v(" "),o("th",[t._v("Description")])])]),t._v(" "),o("tbody",[o("tr",[o("td",[t._v("window.closed")]),t._v(" "),o("td",[t._v("Whether the window has been closed")])]),t._v(" "),o("tr",[o("td",[t._v("window.length")]),t._v(" "),o("td",[t._v("Number of "),o("code",[t._v("