Dom Basics and DOM manipulation html

Source: Internet
Author: User

??


file Object Model ( Document Object Model . Referred to as DOM). is a Standard programming interface recommended by the Organization for the processing of extensible flag languages.

dom in other words, This is the representation and handling of a html xml regular usage of documents. Using the DOM allows us to pass in ajax html xml data for dom mode operation, so that the page dynamic change updates and data extraction processing.

Simple company of the DOM:

in the JAvaScript there is a special object in the Document that can represent the current HTML the root node of the page. the DOM treats each HTML or XML document as an object tree in memory.

in the DOM tree, the document content and very many different types of nodes, are a node object.



for DOM can be viewed using the DOM of the API .


Use:

using server-side return XML data, and then use the HttpRequest objects, and Response accept it as a DOM object to be processed, there are two other ways of getting XML the data.


in the JAvaScript Loading in XML There are two ways in which a document ① load the same domain XML documentation.

② loads a string representing XML .



can use Domapi for XML (in some ways XML is used to store data, allowing users to define their own tags in XML) the operation.

DOM serialization of objects becomes XML string.

is to say XML the file content of all parties as a string.


this is to put a XML The document is exported as a string.


The production of XPath technology:

because the use getElementById or Get Elementbytagname not very good to be sure XML the node



so the XPath technology. the dom4j Open source package in Java has selectsingnode and SelectNodes Such two methods can obtain one or more nodes according to an XPATH expression.


JAvaScript a commentary on the Advanced knowledge in

Array. Simple object creation,JSON data Format, object-oriented JAvaScript Classes define the definition of public properties and methods, and the definition of private properties and methods, the definition of static properties and methods, interface for simulating interfaces and classes.

These have been made with specific notes.



Use DOM mind to manipulate the document. You have to think like that in your head.

Dom Basics and DOM manipulation html

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.