Home >Web Front-end >JS Tutorial >Methods to solve jquery Chinese garbled problem
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".
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
Modify the encoding of your IDE project (or only modify the corresponding HTML)
Screenshot:
Modify the encoding corresponding to the downloaded jquary library
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!