Difference Between HTML and Dom

Difference between HTML and DOM

DOM is a model of a document with an associated API for manipulating it.

HTML is a markup language that lets you represent a certain kind of DOM in text.

Other kinds of DOMs can be expressed in other markup languages, for example RSS and Atom can be converted to a DOM and manipulated with the same API as an HTML or XHTML document (more or less anyway; there are some HTML specific DOM extensions).

What is the difference between source code and DOM?

The notions between a page's source and a page's DOM are similar, but different. The source is the raw HTML that is unadulterated by any client-side scripts. It is the direct response of the HTTP request to the server. The DOM, on the other hand, is the same HTML structure that has been modified by JavaScript.

Source Code reads the page's HTML as if you opened it in a text editor. The source code reflects your HTML structure before any JavaScript is loaded. While the contents can’t be edited, it’s useful to see the HTML the browser receives from the server.

https://developer.apple.com/library/mac/documentation/AppleApplications/Conceptual/Safari_Developer_Guide/ResourcesandtheDOM/ResourcesandtheDOM.html

Try to read about API, I think there are API's for translate and stuff

What is the difference between JavaScript and DOM?

DOM stands for Document Object Model and, as you could guess from the name, represents the structure of an HTML/XML document in a platform/browser independent way. The DOM also provides an API to manipulate the DOM, with functions like getElementsByTagName and createElement.

JavaScript is a programming language that web browsers can execute. JavaScript can interact with the DOM with DOM scripting.

Edit to answer your question in a comment: For example, the browser downloads the HTML along with any referenced JS and CSS (and images, Flash etc.). The browser constructs the DOM from the HTML and renders it using the rules specified in the CSS. JS may manipulate the DOM when the page loads, when the user does something, or when any other event happens. When the DOM changes the browser updates what is displayed.

Document tree is the same as DOM?

Yes.

DOM stands for document object model and describes the tree strcuture of elements that form the (HTML) document.

When the CSS spec talks about a document tree it refers to the same thing.

In the sentence you've cited the document says the information, for example whether a link has been visited or not, is not stored in a DOM node.

Take a look at this screenshot of the Firebug inspector showing a part of the DOM of this question and the DOM properties.

Firebug: Document tree excerpt of this question showing the link to the W3C docs and the DOM properties pane

In CSS you could create this selector and apply styles to a link that has been visited:

a:visited {
...
}

There's no visited attribute in the DOM node that Javascript could access too, thus this informaion is outside the DOM tree.

What is the difference between XML DOM and HTML DOM

The main difference is that the HTML DOM knows about HTML: it knows, for example, that a table contains a table body which contains table rows, and it will ensure that when you add and remove nodes to the tree that this structure is correctly maintained.

What's the difference between the Browser Object Model and the Document Object Model?

The Browser Object Model is a larger representation of everything provided by the browser including the current document, location, history, frames, and any other functionality the browser may expose to JavaScript. The Browser Object Model is not standardized and can change based on different browsers.

The Document Object Model is standardized and is specific to current HTML document. It is exposed by the Browser Object Model (i.e., DOM is a subset of BOM).

difference between COM and DOM

COM (Component Object Model) is a cross-language programming model for the Microsoft Windows platform based on interfaces inheriting from a common ancestor (IUnknown) providing a way to create, and then dynamically discover and use various software libraries (the components).

For example, the whole Windows Shell is a set of COM libraries, and the Windows Explorer makes uses of components to extend its default capabilities, for example to add new toolbars, or provide property sheets for various file types.

COM is a rather complicated technology to learn, full of pitfalls, and heavily based on the Windows registry and GUIDs (like... {21EC2020-3AEA-1069-A2DD-08002B30309D}).
It uses reference counting to handle the memory allocation and liberation of components.
COM provides several ways to instanciate those components, the various "threading models".

I invite you to read the wikipedia entry for COM, as there is much more to be said about it: http://en.wikipedia.org/wiki/Component_Object_Model

DOM is a completely unrelated technology.

Web pages in browsers are built upon SGML, and now XML based-languages, the HTML family.

These languages are hierarchical in the sense that they are comprised of container tags that in turn contain other tags.

<html>
<body>
<img src="t.jpg" />
</body>
</html>

The DOM (Document Object Model) is a standardized way of accessing this hierarchy via programming, either for reading, or for modification, usually by using languages like Javascript.

It also provides the various events that can be used to enhance web pages interactivity, like the "onclick", "onload" events...

The W3C has played a great role in standardizing this model, so that the various browsers can be (mostly) compatible and use the same javascript code to manipulate the DOM of pages.



Related Topics



Leave a reply



Submit