Stasus Error in Ajax

Source: Internet
Author: User

first, the English version of the analysis

0: (uninitialized) The Send () method has a not yet been invoked.
1: (Loading) The Send () method has been invoked, request in Progress.
2: (Loaded) The Send () method has completed, entire response received.
3: (Interactive) The response is being Parsed.
4: (completed) The response has been parsed, was ready for harvesting.

second, the Chinese version of the analysis
0-(uninitialized) has not yet called the Send () method
1-(load) called the send () method, sending the request
2-(loading Complete) The Send () method executes and has received the full response content
3-(interactive) Parsing Response Content
4-(complete) The response content resolution is complete and can be invoked on the client

third, Detailed analysis

In summary, the life cycle of the entire XMLHttpRequest object should contain the following phases:
Create-initialize request-send request-receive data-parse data-complete

In specific applications, it is clear that the meaning of the Readystate's five states (each stage of the life cycle of the XMLHttpRequest Object) can eliminate the mystery of the Ajax core (the vague behind is either a trick or a mystery, or "Ichica, Shoro") , the rapid grasp of its essence, to reduce frustration in learning and enhance self-confidence is extremely beneficial.

For example, through the following examples:



When you request a remote file in ajax, or if the remote file is being dropped, you need to know the status of the remote server feedback to determine whether the file exists or Not.
of course, when we usually browse the Web page, we also find that some files do not exist when the display as "404 error", which is the common HTTP request State (status)
When a Web server responds to a request from a browser or other client, its answer generally consists of a status line, several answer headers, a blank line, and a content Document. Here is one of the simplest answers:
The status line contains the HTTP version, the status code, and a brief description of the status Code. In most cases, all answer headers except Content-type are Optional. however, Content-type is required, and it describes the MIME type of the document that Follows. Although most replies contain a document, there are also some that do not include, for example, a reply to a head request that never comes with a document. There are many status codes that are actually used to identify a failed request that does not contain a document (or contains only a brief description of the error message).
When a user tries to access content on a server that is running Internet information Services (IIS) over HTTP, IIS Returns a numeric code that represents the status of the Request. The status code can indicate whether a specific request has succeeded, and can reveal the exact cause of the request Failure.

1xx-informational Tips
These status codes represent a temporary response. The client should be prepared to receive one or more 1xx responses before receiving a regular response.
· 100-continue the initial request has been accepted, the customer should continue to send the remainder of the Request. (HTTP 1.1 New)
· 101-switching protocols Server translates the Client's request to another protocol (HTTP 1.1 New)

2xx-success
This type of status code indicates that the server successfully accepted the client Request.
· 200-ok Everything is ok, the answer document for Get and post requests is Followed.
· The 201-created server has created the document, and the location header gives its url.
· 202-accepted has accepted the request, but the processing has not been completed.
· The 203-non-authoritative information document has returned normally, but some of the answer headers may be incorrect because a copy of the document is being used, non-authoritative (HTTP 1.1 new).
· 204-no Content does not have a new document, the browser should continue to display the original Document. This status code is useful if the user refreshes the page on a regular basis and the servlet can determine that the User's document is new Enough.
· 205-reset content is not new, but the browser should reset what it displays. Used to force the browser to clear the form input (HTTP 1.1 new).
· The 206-partial Content client sends a GET request with a range header that the server has completed (HTTP 1.1 new).

3xx-redirect
The client browser must take more action to implement the Request. For example, The browser might have to request a different page on the server, or repeat the request through a proxy server.
· 300-multiple Choices customer-requested documents can be found in multiple locations that are listed in the returned Document. If the server wants to make a preference, it should be indicated in the location answer Header.
· 301-moved permanently The document requested by the customer elsewhere, the new URL is given in the location header, and the browser should automatically access the new Url.
· 302-found is similar to 301, but the new URL should be treated as a temporary replacement, not a Permanent. Note that the corresponding status information in HTTP1.0 is "Moved temporatily". When the status code appears, the browser can automatically access the new url, so it is a useful status Code. Note that this status code can sometimes be used with 301 Substitutions. For example, if the browser mistakenly requests Http://host/~user (the trailing slash is missing), some servers return 301, and some return 302. Strictly speaking, We can only assume that the browser will automatically redirect only if the original request is Get. See 307.
· 303-see other is similar to 301/302, except that if the original request is post,location, the redirect target document specified by the header should be fetched via get (HTTP 1.1 new).
· The 304-not Modified client has a buffered document and issues a conditional request (typically providing a if-modified-since header indicating that the customer only wants to update the document than the specified date). The server tells the customer that the original buffered document can continue to be used.
· 305-use Proxy The document requested by the client should be extracted via the proxy server indicated by the location header (HTTP 1.1 is new).
· 307-temporary Redirect and 302 (Found) are the Same. Many browsers incorrectly respond to a 302 response for redirection, even if the original request is post, even though it can actually be redirected only if the answer to the POST request is 303. For this reason, HTTP 1.1 has been added in 307 to allow for more cleanup of the region in several status codes: when a 303 response occurs, the browser can follow the redirected get and post requests, and if the 307 answer, the browser can only follow the redirect to the Get Request. (HTTP 1.1 New)

4xx-client Error
An error occurred and the client appears to be having Problems. For example, a client requests a page that does not exist, and the client does not provide valid authentication Information.
· 400-bad Request Syntax error Occurred.
· 401-unauthorized access was denied and the customer attempted to access a password-protected page without Authorization. A www-authenticate header is included in the answer, and the browser displays the user Name/password dialog box, and then makes a request again after filling in the appropriate authorization Header. IIS defines a number of different 401 errors, which indicate a more specific cause of the Error. These specific error codes are displayed in the browser, but are not displayed in the IIS log:
· 401.1-login Failed.
· 401.2-the server configuration caused the login to Fail.
· 401.3-not authorized due to ACL restrictions on Resources.
· 401.4-filter Authorization Failed.
· 401.5-ISAPI/CGI Application Authorization Failed.
· 401.7– access is denied by the URL authorization policy on the Web server. This error code is specific to IIS 6.0.
· 403-forbidden resource is not available. The server understands the Customer's request, but refuses to process it. This is usually caused by the permissions set on the file or directory on the Server. Forbidden Access: IIS defines a number of different 403 errors, which indicate a more specific cause of the error:
· 403.1-execution Access is Forbidden.
· 403.2-read Access is Forbidden.
· 403.3-write Access is Forbidden.
· 403.4-requires SSL.
· 403.5-requires SSL 128.
· The 403.6-IP address is Rejected.
· 403.7-requires a client Certificate.
· 403.8-site Access is Denied.
· 403.9-excessive Number of Users.
· 403.10-invalid Configuration.
· 403.11-password Change.
· 403.12-deny access to the mapping Table.
· 403.13-the client certificate is Revoked.
· 403.14-reject Directory List.
· 403.15-client Access Permission Exceeded.
· 403.16-client certificate is not trusted or invalid.
· 403.17-the client certificate has expired or is not yet valid.
· 403.18-the requested URL cannot be executed in the current application Pool. This error code is specific to IIS 6.0.
· 403.19-CGI cannot be executed for clients in this application Pool. This error code is specific to IIS 6.0.
· 403.20-passport Login Failed. This error code is specific to IIS 6.0.
· 404-not Found could not find the resource at the specified Location. This is also a common answer.
· 404.0-(none) – No files or directories found.
· 404.1-unable to access the WEB site on the requested Port.
· The 404.2-web service extension lockout policy blocks this Request.
· The 404.3-mime mapping policy blocks this Request.
· 405-method not allowed request method (GET, POST, HEAD, Delete, PUT, trace, etc.) does not apply to the specified resource, the HTTP verb used to access this page is not allowed (the method is not allowed) (http 1.1 new)
· 406-not acceptable The specified resource has been found, but its MIME type is incompatible with the client specified in the Accpet header, the client browser does not accept the MIME type of the requested page (HTTP 1.1 new).
· 407-proxy authentication Required requires proxy authentication, similar to 401, to indicate that the client must be authorized by the proxy server First. (HTTP 1.1 New)
· 408-request Timeout The customer has not made any requests during the waiting time of the server License. Customers can repeat the same request at a later Time. (HTTP 1.1 New)
· 409-conflict is usually associated with a put Request. The request cannot succeed because the request conflicts with the current state of the Resource. (HTTP 1.1 New)
· The document requested by 410-gone is no longer available, and the server does not know which address to redirect To. It differs from 404 in that returning 407 means that the document has permanently left the specified location, and 404 indicates that the document is unavailable for unknown reasons. (HTTP 1.1 New)
· The 411-length Required server cannot process the request unless the client sends a content-length header. (HTTP 1.1 New)
· 412-precondition Failed Some of the prerequisites specified in the request header failed (HTTP 1.1 new).
· 413–request Entity Too Large the size of the target document exceeds the size that the server is currently willing to handle. If the server thinks it can process the request later, it should provide a Retry-after header (HTTP 1.1 new).
· 414-request URI Too Long URI is too lengthy (HTTP 1.1 new).
· 415– Media Types not Supported.
· The 416–requested range not satisfiable server does not meet the Range header specified by the customer in the Request. (HTTP 1.1 New)
· 417– Execution Failed.
· 423– a locked Error.

5xx-server Error
The server could not complete the request because it encountered an Error.
· The 500-internal server Error server encountered unexpected conditions and was unable to complete the Client's Request.
· 500.12-the application is busy restarting on the Web server.
· The 500.13-web server is too busy.
· 500.15-direct request Global.asa is not Allowed.
· 500.16–unc authorization credentials are Incorrect. This error code is specific to IIS 6.0.
· The 500.18–url authorization store cannot be Opened. This error code is specific to IIS 6.0.
· 500.100-internal ASP Error.
· The 501-not implemented server does not support the functionality required to implement the request, and the header value specifies the configuration that is not Implemented. For example, a customer sends a put request that is not supported by the Server.
· When a gateway or proxy is 502-bad, the server returns an illegal response in order to complete the request to access the next Server. It also says that the Web server received an invalid response when it was used as a gateway or proxy server.
· The 502.1-cgi application timed Out.
· 502.2-CGI Application Error.
· The 503-service unavailable service is unavailable and the server is unable to answer due to maintenance or overloading. For example, a servlet might return 503 if the database connection pool is Full. A retry-after header can be supplied when the server returns 503. This error code is specific to IIS 6.0.
· When the 504-gateway Timeout network is timeout, it is used by the server acting as the proxy or gateway, indicating that the answer cannot be received from the remote server in a timely manner. (HTTP 1.1 new).
· The HTTP version indicated in the request is not supported by the 505-HTTP version not supported Server.

source: Excerpt from: http://hibeary.iteye.com/blog/697997, thanks to the author

Stasus Error in Ajax

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.