In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article "what is the interaction process of ajax" is not understood by most people except programmers. Today, in order to make you understand "what the interaction process of ajax is", Xiaobian summarized the following contents, which have certain reference value. The detailed steps are clear and the details are handled properly. I hope you can get something through this article. Let's take a look at the specific content.
The steps of ajax interaction process: 1, create XMLHttpRequest object; 2, specify the type of request, URL and whether to process the request asynchronously; 3, set the content encoding type when sending information to the server; 4, send the request; 5, accept the server response data; 6, use JS and DOM to achieve local refresh.
The operating environment of this tutorial: windows7 system, javascript1.8.5 version, Dell G3 computer.
AJAX stands for asynchronous JavaScript and XML. It is a set of related technologies for displaying data asynchronously. In other words, it sends and retrieves data without reloading the page.
Steps of the ajax interaction proc
1. Create a XMLHttpRequest object
Var ajax = new XMLHttpRequest ()
2. Specify the type of request, URL, and whether to process the request asynchronously.
Ajax.open ('GET',url,true)
3. Set the content encoding type when sending information to the server
Ajax.setRequestHeader ("Content-type", "application/x-www-form-urlencoded")
4. Send a request
Ajax.send (null)
5. Accept server response data
Ajax.onreadystatechange = function () {if (obj.readyState = = 4 & & (obj.status = = 200 | | obj.status = = 304)) {}}
6. Use JavaScript and DOM to achieve local refresh
Extended knowledge: how many requests can be made by ajax?
Commonly used post, get, delete. Copy, head, link and so on are not often used.
Difference:
(1) post is more secure than get (because the post parameter is in the request body. Get parameter is above url)
(2) the transmission speed of get is faster than that of post. (the post passes parameters through the request body, and the background receives them through the data stream. The speed is a little slower. While get can be obtained directly by passing parameters through url)
(3) post transfer file big theory has no limit get transfer file size is about 7-8k ie4k
(4) get obtains data post uploads data (there are a lot of uploaded data and the uploaded data are all important data. So post is the best choice at both the security and data levels)
Thank you for your reading. I hope you have a certain understanding of the key issue of "what is the interactive process of ajax?" the specific usage needs to be understood by everyone through hands-on experiments. Try it quickly. If you want to read more articles about relevant knowledge points, welcome to follow the industry information channel!
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.