This article illustrates the solution of the Chinese garbled method when the jquery Ajax approach is passed in Chinese. Share to everyone for your reference, specific as follows:
Using the Ajax method of jquery, in the transfer of Chinese when the Chinese garbled, in accordance with the previous method, modified the jquery file in the ajaxsetting is not good to make
Copy Code code as follows:
Sajaxsettings:{url:location.href,global:true,type: "Get", ContentType: "Application/x-www-form-urlencoded;charset =utf-8 ", Processdata:true,async:true,xhr:function () {return new e.xmlhttprequest}
Nor does it, even in
Add in Ajax
Copy Code code as follows:
ContentType: "Application/x-www-form-urlencoded;charset=utf-8",
And it doesn't work,
It was later found that nothing was added
Plus, it's good.
In addition, it is best to modify Chartset and pagingencoding as UTF-8 in the JSP
<%@ page contenttype= "text/html; Charset=utf-8 "pageencoding=" UTF-8 "%>
At the same time in Java code in the use of the
Response.setcharacterencoding ("UTF-8");
More interested readers of jquery-related content can view this site: A summary of Ajax usage in jquery, a summary of the jquery form operation tips, a summary of common plug-ins and usage in jquery, a summary of jquery operations JSON data techniques, jquery Extension Tips Summary, jquery drag-and-drop effects and tips summary, jquery table (table) Operation tips Summary, "jquery Common Classic Effects Summary", "jquery animation and special effects usage Summary" and "jquery Selector usage Summary"
I hope this article will help you with the jquery program design.