Home >Web Front-end >JS Tutorial >Methods to solve jquery Chinese garbled problem

Methods to solve jquery Chinese garbled problem

藏色散人
藏色散人Original
2020-11-27 10:26:482241browse

Method to solve the jquery Chinese garbled problem: first modify the IDE project; then download the jquary library; then search for "contentType" in the jquery1.6.1 file; finally add "charset=UTF-8".

Methods to solve jquery Chinese garbled problem

Recommended: "jquery tutorial"

The operating environment of this tutorial: Windows 7 system, jquery version 1.6.1, the The method is applicable to all brands of computers.

How to solve jquery Chinese garbled code problem

The ultimate problem of garbled code It’s still an encoding problem

The first step

Modify the encoding of your IDE project (or only modify the corresponding HTML)

Screenshot: Methods to solve jquery Chinese garbled problem

Second step

Modify the encoding corresponding to the downloaded jquary library
Methods to solve jquery Chinese garbled problem
Note: There may be problems with Jquery settings corresponding to different versions
For example: jquery-1.6.1 and jquery-1.8.3 have different definitions.
Solution: In the jquery-1.6.1 file, search for 'contentType' and then add; charset=UTF-8 after application/x-www-form-urlencoded to finally become contentType: "application/x-www-form-urlencoded; charset=UTF-8" is enough.
During data interaction, both the server and the browser set the utf-8 encoding format, so the problem is solved! ! !

The above is the detailed content of Methods to solve jquery Chinese garbled problem. 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