Client-side detection:
(i) Capacity testing
Capability detection is the ability to identify browsers.
The ability to detect a particular browser before writing code. For example, a script might want to detect the existence of a function before calling it.
(ii) Quirks detection
Quirks are actually bugs in the browser implementation. Quirks detection usually involves running a small piece of code and then determining whether a browser has a quirk.
(iii) User agent detection
The browser is identified by detecting the user-agent string.
Dom
(i) Node hierarchy
In an HTML page, the document element is used as a
Each piece of markup can be represented by a node in the tree: The HTML element is represented by an element node, the attribute is represented by an attribute node, the document type is represented by a document type node, and the comment is represented by an annotation node.
There are 12 node types, all of which inherit from a base type.
1.Node type
All node types in JavaScript inherit from the node type, so all node types share the same basic properties and methods.
Each node has a NodeType property that indicates the type of the node.
12 numeric Changlianglai indicates the node type:
1 = = Node.element_node
2 = = Node.attribute_node
3 = = Node.text_node
4 = = Node.cdata_section_node
5 = = Node.entity_reference_node
6 = = Node.entity_node
7 = = Node.processing_instruction_node
8 = = Node.comment_node
9 = = Node.document_node
Ten = = Node.document_type_node
= = Node.document_fragment_node
* = Notation_node
JavaScript Learning Notes (10)----Client detection and DOM