In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains the definition, advantages and disadvantages and working principle of Ajax. Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the definition, advantages and disadvantages and working principle of Ajax.
Definition of Ajax
Ajax is a new method using existing standards. By exchanging a small amount of data with the server, Ajax can update the web page asynchronously, which means that some part of the web page can be updated without reloading the whole web page.
Advantages of Ajax:
The biggest advantage is that there are no refresh updates on the page, and the user experience is very good.
Communicate with the server asynchronously, with more rapid response
Some server work can be transferred to the client, and the client resources can be used to deal with it, so as to reduce the pressure on the server and bandwidth and save space and bandwidth rental costs.
Technical standardization, and widely supported by browsers, no need to download plug-ins or Mini Program
Disadvantages of Ajax:
Ajax does not support browser back return button
There are security issues. Ajax exposes details of interaction with the server.
Unfriendly to search engines
Break the exception mechanism of the program
Not easy to debug
How Ajax works
An intermediate layer is added between the client (such as the browser) and the server: the Ajax engine. The Ajax engine requests data from the server independently. After the front end obtains the data returned by Ajax, the front end can use the new data to update the page or do other operations to asynchronize the user request and the server response, thus ensuring that the page content can be updated locally without refreshing the page.
GET request
GET requests are generally used for information acquisition, which does not have a request body, but instead uses URL to pass parameters (that is, passing data to the background).
GET passes parameters in two steps:
Perform ordinary URL encoding for the data to be sent (with names and values), that is, it consists of pairs of "name = value" (called name / value pairs), each of which is concatenated with "&", such as "name=value&name=value&...&name=value".
Since the name / value pair is appended to the URL address, you need to add a "?" at the beginning of the string of character parameters to indicate the start of the query parameter for URL.
Caching problems with GET requests
For GET requests, the result of the request is cached by the browser, especially under the IE browser. At this point, if the URL of the GET request remains the same, the result of the request is the browser's cache (that is, the result of the last GET request).
The solution to the problem of caching GET requests is to change the URL of GET requests in real time. As long as the URL is different, the cached result of the browser will not be fetched.
To do this, add a timestamp parameter at the end of the URL. Because the timestamp can be accurate to milliseconds, it ensures that the time of each GET request is different, and achieves the purpose of changing the request URL in real time.
At this point, I believe you have a deeper understanding of the definition, advantages, disadvantages and working principles of Ajax. You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.