I recently encountered the problem of passing Chinese parameters. Search online, copy, paste, and publish the "ultimate" solution "is nothing more than escape (STR) for transcoding, and then write a method on the server to edit it again, or use
Jquery1.3.2 and jquery1.4 + do not exist.
Through comparison, we finally find a difference between the two versions.
Jquery1.4 + added a section in the Ajax Method
CodeUsed to call the onreadystatechange method in abort.
Copy codeThe Code is as
Therefore, a Boolean value passed by Ajax is returned during submission. In fact, the get2 () function passed by Ajax is a subfunction of chkfull (BT) and cannot be passed to external functions. Alert () does not work either. Therefore, the "Submit"
I. ajaxsample. aspx
Process business data and generate XML data for jqueryrequest. aspx to call,CodeAs follows:Copy codeThe Code is as follows: protected void page_load (Object sender, eventargs E){String uid = request. querystring ["username"]
Technologies included in Ajax
We all know that AJAX is not a new technology, but a combination of several original technologies. It is composed of the following technologies.
1. CSS and XHTML are used for representation.
2. Use the DOM model for
The implementation of Ajax encoding is a milestone in the construction of the Team framework, so that the framework has a version that can be used for application debugging. In the Ajax framework encoding, we mainly think of the following points:
There are more and more Ajax applications. Most of the Ajax processing is to display a "loading..." on the front-end, and then submit the data to the server for processing. After the processing is completed, the "processing completed" is displayed ".
Let's take a look at a simple piece of JavaScript code returned by jquery Ajax.
Code
Copy code The Code is as follows: function getreturnajax {
$. Ajax ({
Type: "Post ",
Http://www.jb51.net/userexist.aspx ",
Data: "username =" + vusername.
The error method is directly executed to indicate an error. ajax jsonp has never been used before. Its understanding is similar to that of common ajax requests, but it is not well understood. This error occurs, after debugging (checking the backend
Tip: We should always pay attention to browser cache. When using the GET method, we should add the timestamp parameter (net Date ()). getTime () to ensure that the URLs sent each time are different, so that browser cache is avoided.
Tip: when a
For example:
Copy codeThe Code is as follows: function xmlHttpR (){
Var xmlhttp;
If (window. XMLHttpRequest ){
Xmlhttp = new XMLHttpRequest ();
}
Else {
Try {xmlhttp = new ActiveXObject ("Msxml2.XMLHTTP ")}
Catch (e ){
Try {xmlhttp = new
The client is the UTF-8 code, which is now recognized as the standard code
In this case, when AJAX is used to asynchronously obtain the server information of GB2312 encoding, Chinese Character garbled characters are inevitable.
Because the target
Example:
Rsajax. js:
Copy codeThe Code is as follows: var http_request = false;
Function makePOSTRequest (url, parameters ){
Http_request = false;
If (window. XMLHttpRequest ){
Http_request = new XMLHttpRequest ();
If (http_request.overrideMimeType )
For more information about Ajax submission, see here.
Because of code problems, the script house has been corrected. You are welcome to test it.
Xmlns = "http://www.w3.org/1999/xhtml">
Try to submit a few more messages ......
Show message
Because jquery is used, the. abort () method is not found in the manual. I searched the internet and found it at http://ooxx.me/jquery-ajax-abort.orz. the usage of. abort () in jquery is directly used as an example:
Copy codeThe Code is as follows:
Request methods, including GET and POST:
GET
The most common HTTP request is GET. The GET request directly follows the URL and starts with a question mark. (Window. location. search is used in JS ). The parameters can be encoded using
1. WebService. asmx
Process business data and generate weather data in the GetWhether Method for JqueryRequest. aspx to call. The Code is as follows:
Copy codeThe Code is as follows: [System. Web. Script. Services. ScriptService]
Public class
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