This article from: http://blog.csdn.net/lampsunny/article/details/8053967
The following is a detailed list of Ajax parameters in jquery:
Parameter Name |
Type |
Description |
URL |
String |
(Default: Current page address) the address of the request sent. |
Type |
String |
(Default: "Get") Request Method ("Post" or "get"). The default value is "get ". Note: Other HTTP request methods, such as put and delete, can also be used, but are only supported by some browsers. |
Timeout |
Number |
Set the request timeout (in milliseconds ). This setting overwrites the global setting. |
Async |
Boolean |
(Default: True) by default, all requests are asynchronous requests. To send a synchronization request, set this option to false. Note: The synchronous request locks the browser. Other operations can be performed only after the request is completed. |
Beforesend |
Function |
Before sending a request, you can modify the function of the XMLHTTPRequest object, for example, adding a custom HTTP header. The XMLHTTPRequest object is a unique parameter. Function (XMLHttpRequest ){ This; // The options for this Ajax request } |
Cache |
Boolean |
(Default: True) New jquery 1.2 function. setting this parameter to false will not load request information from the browser cache. |
Complete |
Function |
Callback Function after the request is complete (called when the request is successful or fails ). Parameter: XMLHTTPRequest object, success information string. Function (XMLHttpRequest, textstatus ){ This; // The options for this Ajax request } |
Contenttype |
String |
(Default: "application/X-WWW-form-urlencoded") Content Encoding type when sending information to the server. The default value is applicable to most applications. |
Data |
Object, String |
The data sent to the server. Will be automatically converted to the request string format. The GET request will be appended to the URL. View the description of the processdata option to disable automatic conversion. It must be in key/value format. If it is an array, jquery automatically corresponds to the same name for different values. For example, {FOO: ["bar1", "bar2"]} is converted to '& Foo = bar1 & Foo = bar2 '. |
Datatype |
String |
Expected data type returned by the server. If this parameter is not specified, jquery will automatically return responsexml or responsetext Based on the mime information of the http package and pass it as a callback function parameter. Available values: "XML": returns an XML document, which can be processed by jquery. "Html": returns plain text HTML information, including script elements. "Script": returns plain text JavascriptCode. Results are not automatically cached. "JSON": Return JSON data. "Jsonp": jsonp format. When calling a function in the form of jsonp, such as "myurl? Callback =? "Will jquery be replaced automatically? For the correct function name to execute the callback function. |
Error |
Function |
(Default: automatically determines (XML or HTML) This method is called when a request fails. This method has three parameters: XMLHTTPRequest object, error message, and (possibly) captured error object. Function (XMLHttpRequest, textstatus, errorthrown ){ // Generally, textstatus and errorthown have only one value. This; // The options for this Ajax request } |
Global |
Boolean |
(Default: True) Whether to trigger a global Ajax event. Setting false does not trigger global Ajax events, such as ajaxstart or ajaxstop. Can be used to control different Ajax events |
Ifmodified |
Boolean |
(Default: false) obtain new data only when the server data changes. Use the last-modified header information of the HTTP packet to determine. |
Processdata |
Boolean |
(Default: True) by default, data sent is converted to an object (technically not a string) with the default content type "application/X-WWW-form-urlencoded ". If you want to send the DOM tree information or other information that does not want to be converted, set it to false. |
Success |
Function |
Callback Function after successful request. This method has two parameters: the server returns data and returns the status. Function (data, textstatus ){ // Data cocould be xmldoc, jsonobj, HTML, text, Etc... This; // The options for this Ajax request } |
Code: $ (document). Ready (function (){
Jquery ("# clearcac"). Click (function (){
Jquery. Ajax ({
URL: "/handle/do. aspx ",
Type: "Post ",
Data: {ID: '0 '},
Datatype: "JSON ",
Success: function (MSG ){
Alert (MSG );
},
Error: function (XMLHttpRequest, textstatus, errorthrown ){
Alert (XMLHttpRequest. status );
Alert (XMLHttpRequest. readystate );
Alert (textstatus );
},
Complete: function (XMLHttpRequest, textstatus ){
This; // The options parameter passed when calling this Ajax request
}
});
});
});
I. Error: function (XMLHttpRequest, textstatus, errorthrown)
{
}
(Default: automatically determines (XML or HTML) The call time when the request fails. There are three parameters: XMLHTTPRequest object, error message, and (optional) captured error object. If an error occurs, in addition to null, the error message (the second parameter) may also be "timeout", "error", "notmodified", and "parsererror ".
Textstatus:
"Timeout", "error", "notmodified", and "parsererror ".
II. The first parameter XMLHttpRequest returned by the error event has some useful information:
XMLHttpRequest. readystate:
Status Code
0-(not initialized) The send () method has not been called
1-(load) The send () method has been called and a request is being sent.
2-(Loading completed) The send () method is executed completely and all response content has been received
3-(interaction) parse the response content
4-(complete) The response content has been parsed and can be called on the client
3. Data: "{}". If the data is empty, you must pass "{}". Otherwise, the returned data is in XML format. The system prompts parsererror.
4. parsererror exceptions are also related to the header type. And encoding header ('content-type: text/html; charset = utf8 ');
5. XMLHttpRequest. Status:
1xx-Information prompt
These status codes indicate temporary responses. Before receiving a regular response, the client should be prepared to receive one or more 1xx responses.
100-continue.
101-switch protocol.
2XX-success
This type of Status Code indicates that the server successfully accepts client requests.
200-OK. The client request is successful.
201-created.
202-accepted.
203-non-authoritative information.
204-NO content.
205-Reset content.
206-part of content.
3xx-redirection
The client browser must perform more operations to implement the request. For example, the browser may have to request different pages on the server or repeat the request through the proxy server.
301-the object has been permanently removed, I .e., permanent redirection.
302-the object has been temporarily moved.
304-not modified.
307-temporary redirection.
4xx-client Error
The client seems to be faulty when an error occurs. For example, the client does not provide valid authentication information for a page that does not exist in a request. 400-Incorrect request.
401-Access denied. IIS defines many different 401 errors, which indicate more specific error causes. These specific error codes are displayed in the browser but not in the IIS log:
401.1-Logon Failed.
401.2-login failed due to server configuration.
401.3-the ACL is not authorized due to resource restrictions.
401.4-filter authorization failed.
401.5-ISAPI/cgi application Program Authorization failed.
401.7-the access is rejected by the URL Authorization Policy on the Web server. This error code is dedicated to iis6.0.
403-Access prohibited: IIS defines many different 403 errors, which indicate more specific error causes:
403.1-the execution access is forbidden.
403.2-Read access is forbidden.
403.3-write access is forbidden.
403.4-require SSL.
403.5-ssl128 is required.
403.6-the IP address is rejected.
403.7-client certificate required.
403.8-site access is denied.
403.9-too many users.
403.10-the configuration is invalid.
403.11-change the password.
403.12-access to the ing table is denied.
403.13-the client certificate is revoked.
403.14-reject the directory list.
403.15-the access permission of the client is exceeded.
403.16-the client certificate is untrusted or invalid.
403.17-the client certificate has expired or has not yet taken effect.
403.18-the requested URL cannot be executed in the current application pool. This error code is dedicated to iis6.0.
403.19-CGI cannot be executed for clients in this application pool. This error code is dedicated to iis6.0.
403.20-logon to passport failed. This error code is dedicated to iis6.0.
404-not found.
404.0-(none)-No file or directory found.
404.1-unable to access the web site on the requested port.
404.2-the Web service extended locking policy blocks this request.
404.3-the mime ing policy blocks this request.
405-HTTP predicates used to access this page are not allowed (methods are not allowed)
406-the client browser does not accept the MIME type of the requested page.
407-proxy authentication is required.
412-precondition failed.
413-The Request Entity is too large.
414-the request URI is too long.
415-unsupported media type.
416-the requested range cannot be met.
417-execution failed.
423-locking error.
5xx-Server Error
The server cannot complete the request because of an error.
500-internal server error.
500.12-the application is busy restarting on the Web server.
500.13-the Web server is too busy.
500.15-Direct Request to global. ASA is not allowed.
The 500.16-unc authorization credential is incorrect. This error code is dedicated to iis6.0.
500.18-the URL-authorized storage cannot be opened. This error code is dedicated to iis6.0.
500.100-Internal ASP error.
501-the header value specifies the unimplemented configuration.
502-the Web server received an invalid response when used as a gateway or proxy server.
502.1-CGI application timeout.
502.2-CGI application error. Application.
503-the service is unavailable. This error code is dedicated to iis6.0.
504-gateway timeout.
The 505-http version is not supported.
FTP
1xx-Affirmative preliminary reply
These status codes indicate that an operation has started successfully, but the client wants to receive another response before continuing to operate the new command.
110 restart mark the reply.
120 the service is ready and starts in NNN minutes.
125 the data connection is enabled and transmission is starting.
150 the file is in normal state and you are ready to open the data connection.
2XX-a positive response
An operation has been completed successfully. The client can execute new commands. 200 command OK.
202 if no command is executed, there are too many commands on the site.
211 system status or system help reply.
212 directory status.
213 File status.
214 help message.
215name: system type. name indicates the formal system name listed in assignednumbers.
220 the service is ready to execute new user requests.
221 close the control connection. If appropriate, log out.
225 the data connection is opened and there is no transmission in progress.
226 close the data connection. The requested file operation has been successful (for example, transferring a file or dropping a file ).
227 enter the passive mode (H1, H2, H3, H4, P1, P2 ).
230 The user has logged on and continues.
250 the requested file operation is correct and has been completed.
257 "pathname" has been created ".
3xx-Affirmative intermediate reply
The command is successful, but the server needs more information from the client to process the request. 331 the user name is correct and the password is required.
332 You need to log on to the account.
350 the requested file operation is waiting for further information.
4xx-completion of transient Negation
The command fails, but the error is temporary. If the client retries the command, it may be executed successfully. 421 the service is unavailable and the control connection is being closed. If the Service determines that it must be disabled, this response will be sent to any command.
425 data connection cannot be enabled.
426 connectionclosed; transferaborted.
450 file operations not requested. The file is unavailable (for example, the file is busy ).
451 request operation exception termination: processing local error.
452 the requested operation is not performed. Insufficient system storage space.
5xx-permanent completion reply
The command fails. The error is permanent. If the client retries the command, the same error will occur again. 500 syntax error. The command cannot be identified. This may include errors such as too long command lines.
501 syntax error in the parameter.
502 the command is not executed.
503 error command sequence.
504 the command for this parameter is not executed.
530 not logged on.
532 accounts are required to store files.
550 the requested operation is not performed. File is unavailable (for example, the file is not found and no access permission is available ).
551 exceptional request termination: Unknown page type.
552 the requested file operation ended abnormally: exceeds Storage Allocation (for the current directory or dataset ).
553 the requested operation is not performed. The file name is not allowed.
Common FTP status code and Its Causes
150-ftp uses two ports: 21 for sending commands and 20 for sending data. Status Code 150 indicates that the server is preparing to open a new connection on Port 20 and send some data.
226-the command opens a data connection on Port 20 to perform operations, such as file transfer. This operation is successfully completed and the data connection is closed.
230-the status code is displayed after the client sends the correct password. It indicates that the user has successfully logged on.
331-the status code is displayed after the client sends the user name. This status code is displayed no matter whether the user name is a valid account in the system.
426-the command opens the data connection to perform the operation, but the operation has been canceled and the data connection has been closed.
530-the status code indicates that the user cannot log on because the combination of the user name and password is invalid. If you log on with a user account, you may enter the wrong user name or password, or you may choose to allow anonymous access only. If you log on with an anonymous account, the IIS configuration may reject anonymous access.
550-the command is not executed because the specified file is unavailable. For example, the file to get does not exist, or you try to put the file to a directory without the write permission.