Standard XMLHttpRequest methods include:
Abort stops the current request
GetAllResponseHeaders returns all HTTP Request Response Headers as healthy values.
GetResponseHeader ("Header") returns the string value of the specified header.
Open ("method", "url") creates a call to the server. The method parameter can be get, post, or put, and the URL parameter can be relative URL or absolute URL, this method also includes three optional parameters.
Send (content) sends a request to the server
SetRequestHeader ("Header", "value") sets the specified header to the provided value. You must call open
Standard XMLHttpRequest attributes
Onreadystatechange: This event processor is triggered when every state change. Generally, the status of a JavaScript function request is called. Five values are available, 0 = not initialized, and 1 = loading, 2 = loaded, 3 = interaction in progress, 4 = completed
Responsetext server response, indicating the server response, expressed as XML, which can be parsed as a DOM object
Status Server HTTP status code (200 corresponds to OK, 404 corresponds to not found (not found), and so on
Corresponding text of statustext HTTP status code (OK or notfound (not found)
W3C Dom attributes and methods used for dynamic content creation
Document. createelement (tagname) The createelement method on the document object can create elements specified by tagname. If the string div is used as the method parameter, a div element is generated.
Document. createtextnode (text) The createtextnode method of the Document Object creates a node that contains static text.
<Element>. appendchild (childnode) appendchild method adds the specified node to the list of child nodes of the current element (as a new child node ). for example, you can add an option element as a subnode of the select element.
<Element>. getattribute (name) methods are used to obtain the value of the name attribute in the element.
<Element>. setattribute (name, value): set the value of the element name attribute.
<Element>. insertbefore (newnode, targetnode) This method inserts the node newnode as the child node of the current element in front of the targetnode element.
<Element>. removeattribute (name): This method deletes the attribute name from the element.
<Element>. removechild (childnode): This method deletes the child element childnode from the element.
<Element>. replaceChild (newnode, oldnode) replaces the oldnode with the newnode.
<Element>. haschildnodes returns a Boolean value indicating whether the element has child elements.