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, and set the printwriter out = Response.getwriter (), then the JSP will produce Chinese garbled.
4.ajax reason to return XML garbled
Response.setcontenttype ("TEXT/XML;CHARSET=GBK");
PrintWriter out = Response.getwriter ();
That's how it works, if it does:
PrintWriter out = Response.getwriter ();
Response.setcontenttype ("TEXT/XML;CHARSET=GBK");
So Response.setcontenttype ("TEXT/XML;CHARSET=GBK"), it does not work so the return is garbled, this problem for a long time, the code has to look carefully ah.
5.ajax form Submission
Xmlhttp.setrequestheader ("Content-type", "application/x-www-form-urlencoded");
Since the pass is UTF-8 encoded, the corresponding transcoding should be taken when accepting in the action or servlet
6. Dynamic page of the client page cache Ajax does not run
It may be necessary to use Ajax when registering the code username, uploading files online, deleting files, voting programs, and so on without having to refresh the Web page for results. The principle is that JavaScript through the onchange, OnClick, onmouseout and other events to read the Web page of some of the current user action data, and then transfer this data to a dynamic Web page for processing.
Ajax calls the dynamic page that should let this dynamic page not load the client's cache. Similarly, the blog's trackback program, often unable to receive information, can try to write a dynamic page of the trackback program before it is written to the cached statement.
In addition, you can also program code
+math.random ();
Makes it possible to submit a random number each time to avoid client caching.