JavaScript's DOM concept and DHTML concepts

Source: Internet
Author: User

First, the DOM overview:

1.DOM Explanation: DOM (Document Object model).

D (document) can be understood as a Web page document that is loaded as a whole, a tagged document

O (object) encapsulates an instance of a property and behavior, and can call properties and methods directly

M (model) All tagged documents have an embodiment of some common features, tagged documents (tags, attributes, tags in the encapsulated data), can also be understood as a Web page document tree structure.

2.DOM function:

Used to encapsulate a tagged document as an object and encapsulate all the contents (labels, text, attributes, etc.) in a tagged document as objects

The purpose of encapsulation is to make it easier to manipulate the documents and all the contents of the document, because objects can have properties and behaviors that are called.

Simply put, the standard way to access and manipulate tagged documents is defined (as long as the tagged document DOM is a technique that can be manipulated).

Analytical methods for 3.DOM technology:

Resolves a tagged document to a DOM tree and encapsulates the contents of the tree into a node object

Benefits: You can do any of the nodes in the tree, such as adding or deleting changes

Cons: This parsing requires the entire tagged document to be loaded into memory, meaning that if the tagged document is large in size, it is a waste of memory space

Note: Another way to parse:

SAX, is defined by some organizations, a common way of parsing, not the standard (DOM is the standard), this parsing method is based on event-driven parsing, the speed of data acquisition, but can not change the tag to delete the action

  4.DOM Tree:

When loading an HTML page, the Web browser generates a tree structure that represents the internal structure of the page. The DOM understands this tree structure as composed of nodes.

5. Types of nodes:

      • The entire document is a document node
      • Each HTML tag is an element node (common)
      • Text that is contained in an HTML element is a text node (common)
      • Each HTML attribute is an attribute node (common)
      • Comments belong to note nodes

6.DOM Rating: DOM has three levels, namely DOM1, DOM2, DOM3
DOM1: Encapsulates HTML documents into objects, becoming the world's standard in October 1998. The browsers supported by DOM1 include ie6+, Firefox, Safari, Chrome, and opera1.7+.

DOM2: Added new features on DOM1, such as resolving namespaces

DOM3: Encapsulates an XML document as an object

All DOM objects in Ps:ie are implemented in the form of COM objects, which means that the DOM in IE may differ somewhat from other browsers.

ii. DHTML: Dynamic HTML

is not a language, it is a short term for a number of technical complexes, which contains the Html,css,dom,javascript

Html,css,dom,javascript this four-door technology again Dynamic HTML page effect when defined, responsible for the responsibilities:

HTML: is responsible for providing labels, encapsulating the data, in order to facilitate the operation of the data in the tag. Simply put: Encapsulate data with labels

CSS: Responsible for providing style attributes, defining the style of the data in the tag. Simply put: style definition of data

DOM: Responsible for parsing and encapsulating all the contents of a tagged document and a document, and wrapping it into objects, defining more properties and behaviors in the object, and making it easier to manipulate objects. Simply put: Make documents and labels and other content into objects

JavaScript: Responsible for providing the programming language, the logical operation of the objects in the page. Simply put: Responsible for the behavior of the page definition, is the dynamic effect of the page

Dhtml+xmlhttprequest=ajax

JavaScript's DOM concept and DHTML concepts

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.