DOM basics and DOM operations HTML
??
Document Object Model (DOM) is a standard programming interface recommended by W3C for processing Extensible Markup Language. DOM can access and modify the content and structure of a document in a way independent of platform and language. In other words, this is a common way to represent and process an HTML or XML document. DOM allows us to perform DOM operations through HTML and XML data in AJAX, so as to dynamically modify and update pages and extract data.
Simple introduction to DOM:
In JAvaScript, there is a special object document, which can represent the root node of the current HTML page. DOM treats every HTML or XML document as an object tree in memory ..
In the DOM tree, the document content corresponds to many different types of nodes and is a NODE object.
You can view DOM APIs for DOM usage.
Usage:
XML data is returned by the server, and then accepted as a DOM object using the HTTPRequest object and response. XML data can be obtained in two ways.
There are two ways to load XML documents in JAvaScript: ① load XML documents in the same domain. ② Load a string that represents XML.
DOMAPI can be used for XML (in some sense, XML is used to store data, so that users can customize the tag in XML) operations.
The DOM object is serialized into an XML string. The content of an XML file is a string of all parties.
This is to output an XML document as a string.
The emergence of XPath technology:
Because the use of getElementById or getElementByTagName is not very good at determining the XML Node
Therefore, the XPath technology is generated. In Java, the DOM4j open-source package includes selectSingNode and selectNodes. You can use the XPATH expression to obtain one or more nodes.
Introduction to advanced knowledge in JAvaScript
Array, simple object creation, JSON data format, object-oriented JAvaScript Classes define public attributes and methods, private attributes and methods, static attributes and methods, simulated interfaces, and class implementation interfaces. These have made detailed notes.