In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "what is AJAX". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is AJAX".
In order to better read this series of tutorials, readers have the following requirements:
L familiar with HTML.
L familiar with HTTP protocol.
L familiar with javascript.
L familiar with XML.
L familiar with XML DOM.
AJAX is not a new technology, it's just a new standard. According to the personal understanding of the dish, the so-called AJAX technology, that is, in order to achieve the background interaction between the client and the server, take xml as the information carrier, use javascript for control, and interact through the HTTP protocol to achieve the effect of partial refresh of the html interface.
Let's talk a little bit about these technologies.
HTML has nothing to say.
The content of HTTP agreement is more. In AJAX practice, it will involve POST, GET method request data, HTTP header information construction, data parsing format, etc., mainly these three items, see which one is not familiar with, hurry up tutoring! But it's all simple, no pressure.
The small dish thinks that AJAX is writing a Javascript script, and javascript is responsible for declaring a vital XMLHttpRequest object, which sends a request to the server through the POST or GET method, obtains the return data in the format of xml, and then parses the xml and displays it on the interface. This is the AJAX execution process.
Xml is nothing more than a data specification, which can make the data have a certain structure, so it is convenient for data organization and data expansion.
The basic components of xml are elements, which are often called tags in HTML, such as:;, while elements and elements can be nested, such as:. At the same time, an element can have attributes, such as:.
In this way, xml can represent very rich and flexible information, and can even be used as a small database.
Here, a little mention, it is recommended to use the method of child elements to extend elements, for example, it is not recommended to extend elements in the way of attributes, for example, because child elements are more flexible than attributes and are in line with the design idea of xml.
If you want to operate xml with Javascript, you must have a basic knowledge of DOM (Document Object Model). In order to make it easier for readers to learn, a brief introduction to XML DOM.
According to the definition of DOM, each component in xml is a node. According to the understanding of the side dish, the meaning of the ingredient is the part of xml.
The details are as follows:
The entire document is a document node.
Each xml tag is an element node. For example, a pair of tags, also known as element nodes, also known as elements.
The text contained in the xml element is a text node. For example, 1001 Nights, where "1001 Nights" is the text node.
The attribute of the xml element is called the attribute node. For example, where serialNumber is the attribute node.
A node has three very important attributes, namely: nodeName (node name), nodeValue (node value), and nodeType (node type). Among them, nodeName and nodeValue are very commonly used and must be understood.
For nodeName (read-only), there are:
The nodeName of the node of the l element is the same as the tag of the element. For example, an element whose nodeName is book.
The nodeName of the attribute node is the attribute name. For example, if the attribute node is serialNumber, its nodeName attribute is also serialNumber.
The nodeName of the text node is a fixed # text string. For example, for 1001 nights, the text node is "1001 nights", and its nodeName will return the fixed string "# text".
For nodeValue (read / write):
The nodeValue of the node of the l element returns undefind. For example, an element whose nodeValue property returns undefind.
The nodeValue of the attribute node is the value of the attribute. For example, the attribute node is serialNumber, and its nodeValue returns 0905024.
The nodeValue of the text node is the text itself. For example, 1001 Nights, the text node is "1001 Nights" and its nodeValue returns "1001 Nights". You must pay special attention to this! In this example, the name element contains a "1001 night" text node, and "1001 night" is not the nodeValue of the name element! The value (nodeValue) of the name element is undefind! Therefore, it should be noted in actual programming that when you get the name element, you have to further obtain the text nodes contained in the element, such as firstChild and childNodes [0], before you can read out the text content with the nodeValue attribute.
To sum up, you can use a diagram to summarize AJAX technology:
Thank you for your reading, the above is the content of "what is AJAX", after the study of this article, I believe you have a deeper understanding of what is AJAX, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.