In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article shows you what is the core object of AJAX, the content is concise and easy to understand, it will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
Ajax is a new technology that was born in February 2005 but is now in hot demand. This new technology can greatly improve the user experience of the website.
What is Ajax?
Ajax is the abbreviation of Asynchronous Javascript and XML (Asynchronous JavaScript and XML).
The core idea of Ajax is to use XMLHttpRequest objects to send asynchronous requests. Ajax is not a new language or technology, but actually several technologies are combined in a certain way to play their respective roles in common cooperation.
Advantages of Ajax
1. Lighten the burden on the server. The principle of Ajax is "fetch data on demand."
two。 There is no need to refresh the page, reducing the user's psychological and actual waiting time.
3. Bring a better user experience.
4. We can transfer the work of some previous servers to the client, make use of the idle ability of the client to deal with it, reduce the burden on the server, make full use of broadband resources, and save space and broadband rental costs.
5. External data can be called.
6. Based on standardized and widely supported technology, there is no need to download plug-ins or Mini Program.
7. Further promote the separation of page presentation and data.
II. Introduction to xmlhttprequest object
One of the biggest features of Ajax is that it can transfer or read and write data to the server without refreshing the page (also known as no refresh update page), which is mainly due to the XMLHTTP component XMLHttpRequest object.
XMLHttpRequest attribute
Properties of the XMLHttpRequest object
Attribute
Description
Onreadystatechange
This event handler is triggered when each state changes, and a JavaScript function is usually called to readyState the status responseText server response, which is expressed as a string responseXML server response, as XML, and this object can be parsed into the corresponding text of a DOM object status server's HTTP state statusTextHTTP state.
This event handler is triggered each time the state changes, and a JavaScript function is usually called
XMLHttpRequest method
Some common methods of XMLHttpRequest object
Method description abort () stops the current request getAllResponseHeaders () returns all corresponding headers of the HTTP request as a key / value pair getResponseHeader ("header") returns a string value of the specified header open ("method", "url") to establish a call to the server. The method parameter can be GET,POST or PUT, etc.; the url parameter can be opposite URL or absolute URL. This method also includes three optional parameters send (content) to send a request to the server setRequestHeader ("header", "value") to set the specified header to the provided value, before setting any header, you must first call the open () method. What is the AJAX core object? have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are 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.