Tag: Ike server error URL www redirect LAN benefit str request
What is Ajax? What is the role of it? What are the benefits of this process? How to set the request header???????? ( hehe, don't know please look down oh ):
1) What is Ajax?
Ajax, "asynchronous Javascript and XML" (Asynchronous JavaScript and XML), refers to a web development technique that creates interactive Web applications.
2) What is the role of Ajax?
Ajax enables Web pages to be updated asynchronously by exchanging small amounts of data in the background with the server. This means that you can update a part of a webpage without reloading the entire page.
In layman's terms: it's a technique for creating fast, Dynamic Web pages, and it's a technique to update parts of a Web page without reloading the entire page.
3) But what are its benefits?
1, the user experience is particularly good
2, greatly improve the efficiency
3, no refresh dynamic loading data
4) What is the process of Ajax?
1. Create an Ajax object (new XMLHttpRequest () | | | New ActiveXObject ("Microsoft, XMLHTTP"));
2, open (),//opens, it has three parameters (method of submission, address, true);
3, send ();//Submit
4. Monitor the status of the server (onreadystatechange)
5) Set the request header
setRequestHeader ("Content-type", "application/x-www-from-urlencoded")
Listen to some of the server's status code (hee, probably say some of the commonly used)
To establish the status of the connection:
0: Non-initialization of the representative;
1: the representative launches;
2: the Representative sends;
3: the Representative accepts;
4: the representative completes;
Feedback from the server:
100: Indicates that the customer must continue to make the request;
200: Indicates a successful request;
300: Indicates redirection;
400: Indicates a client error;
500: Indicates a server error;
said so much is to encapsulate Ajax to pave the way, but how exactly encapsulated Ajax??? I'll tell you a little bit like I did (hehe)
The role of JavaScript Ajax, the process, and how to set the request header