BOM and DOM differences and relations

A, BOM and DOM differences

1.BOM(Browser Object Model)

That BOM browser object model, BOM no standards, the core target BOM is the window object . The window object provides both javascript API to access the browser, while serving as Global objects in ECMAScript. BOM and close the browser, the browser can be a lot of things through javascript control, such as opening a window, open the tab, close the page, favorites, etc. These functions are independent web content. Since there is no standard, different browsers implement the same function can be achieved through different ways. For example, this feature Add to Favorites:
IE browser: window.external.AddFavorite (url, title);
FireFox browser: window.sidebar.addPanel (title, url, "");

Although there is no uniform standard, but common features of each browser js code similar, for commonly used functions have a default standard.

2.DOM(Document Object Model)

DOM Document Object Model, DOM is the W3C standard, the most fundamental objects DOM is the Document (the window.document) , this object is actually a property of the window object, the object is unique is that this is the only one belonging to both BOM and belongs DOM objects. DOM and documents related to the document here refers to the web page, which is the html document. DOM and browser-independent, he is interested in the content of the page itself, and because the browser does not have much relationship, so set a standard like.
 
Two, BOM and DOM ties
 

Guess you like

Origin www.cnblogs.com/vickylinj/p/10927154.html