JQuery Ajax method in Chinese when the solution to the Chinese garbled method _jquery

Source: Internet
Author: User

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

Type: ' POST ',

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.

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.