Home  >  Article  >  Web Front-end  >  Solution to jquery Chinese garbled characters

Solution to jquery Chinese garbled characters

藏色散人
藏色散人Original
2020-12-03 09:13:001881browse

The jquery Chinese garbled code is because the contentType does not specify the encoding. The solution: first search for "contentType" in jQuery.js; then add the code after x-www-form-urlencoded as "charset=UTF- 8” is enough.

Solution to jquery Chinese garbled characters

The operating environment of this tutorial: Windows 7 system, jquery version 1.10.0, Dell G3 computer.

jQuery perfect solution for Chinese garbled characters

Recently encountered the problem of Chinese garbled characters using jQuery. In fact, his Chinese garbled characters are because the contentType does not specify the encoding. , just search for

'contentType'

in jQuery.js and then add

; charset=UTF-8 after application/x-www-form-urlencoded

eventually became

contentType:"application/x-www-form-urlencoded; charset=UTF-8"

The problem is solved, I think the funniest thing is that so many people on the Internet are transcoding again in their own code, and they also wrote Very detailed analysis, how to transfer, so funny.

Recommended: "jquery video tutorial"

The above is the detailed content of Solution to jquery Chinese garbled characters. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn