Find some resources on the Internet to understand this is a coding problem, my server sent over the data is GB2312 encoded, and Ajax to receive the data as UTF-8 encoded.Many of the online solutions are server-side based on PHP, JSP, and so on, to
Well, as the saying goes, easier said than done, put on the programming is easy to make up the difficulty, although there is no new technology Ajax, but the transformation of ideas and the integration of old technology, but to move hands or problems,
In this case, the native cache is checked first for Ajax acquisition, and if the native cache already has the same content, the remote server is not accessed. Such operations can improve speed and reduce server pressure. But the drawbacks are also
Eclipse Debug does not enter an action when the XML document returned by response in 1.ajax,action is malformed.
2.ajax cache problem, you need to join Xmlhttp.setrequestheader ("If-modified-since", "0″"), you can solve.
3. If not AJAX submission,
Copy Code code as follows:
/**
* @author Supersha
* @QQ: 770104121
*/
ajax document
Comments:
An Ajax object accepts an object literal as a parameter that contains the Method,url,success,params,fail parameter
Method:
When there are many form data items, it becomes inefficient to manually get the values of the table items, combined with the function serialize () provided by jquery, which enables you to quickly get data and submit the form data.
Take a look at
One of the problems that you encounter when you do an AJAX login
When the incoming parameter contains special characters, such as: "$ ' #@" and so on. There is a problem with parameter passing and cannot get it correctly.
$.ajax ({
URL:
The first step in solving IE coding problem:
DataType: ($.browser.msie)? "Text": "xml" first lets IE recognize whether the text or XML is returned
Step Two:
Copy Code code as follows:
function Parsexml (XML) {//xml IE encoding problem step
Today, I met a very painful problem. The asynchronous function $.ajax of jquery is called in one function, and then there is a section of jquery code outside the $.ajax function. Each time the code after the $.ajax is executed first.
Search on the
Ajax friends must know that JavaScript is using UTF-8 International code, that is, each Chinese character is stored in 3 bytes, but this causes the use of Ajax to send data when garbled.One solution is to use encodeURIComponent Plus modify
Introduction: In jquery Ajax POST request, the request, which Chinese in the background, display as garbled, how to solve it?
Introduction of the problem:
Copy Code code as follows:
var Regid = $ (' #oregion '). ComboBox (' GetValue
Now that your server is returning 304 not modified
That means that you have not modified the XML file on the server, or the page to be loaded has not been modified locally, the local cache has caused this problem
A common way to prevent caching
ajaxtext1.jsp
Copy Code code as follows:
Input:
Golden Ball: Lionel Messi
c Luo
ajaxtest2.jsp
Copy Code code as follows:
Request.setcharacterencoding ("Utf-8");
String
Copy Code code as follows:
if ($_files) {
?>
Die
}
?>
Object oriented thinking, form submits to a hidden IFrame, executes the callback JS function. Implement a picture echo. The function of the backstage PHP is not
Methods in the Ajax engine object:
Abort () Stop the current request
getAllResponseHeaders () returns the complete headers as a string
getResponseHeader ("Headerlabel") returns a single header label as a string
Open ("Method", "URL" [, asyncflag[, "
The technology that Ajax contains
We all know that Ajax is not a new technology, but a combination of several original technologies. It is a combination of the following technologies.
1. Use CSS and XHTML for presentation.
2. Use the DOM model for
A Load () method (simplest)
Load (Url,[data],[callback])
URL: Loaded page address
Data: Optional, sent to the server, the format is Key/value
Callback: Optional, callback function
1. The simplest application
Copy Code code as follows:
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