We talked about DOM in the previous blog. We will continue BOM in this blog.
1. What is BOM?
BOM is called the Browser Object Model. You can operate on these objects in the browser.
Architecture 2
BOM provides many objects for accessing the browser. BOM lacks standards, and every browser provider expands it according to their own ideas. Then, the common objects of browsers become the standards of facts. Therefore, bom itself has no standards or no organization has standards. Its core is window, which indicates an instance of the browser. When we open a window of the browser, the system will automatically define a window object for it, with the window object, we can use it to access the functions of the browser, for example, the prompt dialog box. Window. alert ("method of window object "). Because windows are global and the whole web page, all windows here can be omitted.
Window objects and common objects also have properties and Methods. With these properties and methods, we can implement browser operations. The browser encapsulates the functions that the browser can implement in the object, specifically the attributes and methods of the object. You only need to use the attributes and methods of these objects to achieve the desired effect. These objects are more like interfaces left by the browser to the outside world. You only need to use them. There is no need to know how to implement them internally.
Window objects have a series of class attributes, which are also objects. As shown in, window objects include document objects, frames objects, history objects, and location objects. When a webpage is opened, these objects are automatically generated along with the window object. The combination between the window object and other objects.
When you create an html page, the browser parses the tag in the html page into a node in the DOM to form a DOM structure tree. This part of content has been explained in javascript --- html dom. If you have any questions, please move on. In short, DOM is a part of BOM. BOM is a large system consisting of objects provided by browsers, and DOM is a small system in this system that only involves documents. 5. BOM encapsulates various browser operations as objects. By operating these objects, the browser can be manipulated. It is an interface provided by the browser to the outside world. DOM is part of BOM. javascript scripts use these objects to implement dynamic web page functions.