The BOM (Browser object model) refers to the browser's objects models, which make JavaScript capable of "talking" to the browser.
The DOM (Document Object model) refers to all the elements of an HTML document that can be accessed by using it.
The Window object is one of the top-level objects of the client-side JavaScript, and since the Window object is a common ancestor of most other objects, the Window object's reference can be omitted when invoking the methods and properties of the Window object. For example: Window.document.write () can be simply written as: document.write ().
Common methods:
Location
To view the URL of the current URL:
Location.href
Modify URL:
location.href= ' http://qq.com '
Refresh URL: Parentheses required
Pop-up box
var a = alert ('---warning box---'), Console.log (a), var c = confirm ('---you confirm?---'), Console.log (c), var p = prompt ('---cue box---'); Console.log (P);
Timing Correlation: Set
Do one thing after the specified time: SetTimeout ()
SetTimeout (What to do, time milliseconds)
t = setTimeout (f1= () =>{console.log (' difficult to be difficult to be moral ');},3000)
Stop this thing:
Cleartimeout (t)
Do one thing at a time: setinterval
t = setinterval (f2= () =>{console.log (' What's this ', ' n '); Console.log (' Ooxx ');},1000)
Stop this.
Clearinterval (t)
JavaScript BOM & DOM