Home > Web Front-end > JS Tutorial > How to deal with jquery load Chinese garbled characters

How to deal with jquery load Chinese garbled characters

coldplay.xixi
Release: 2023-01-04 09:37:58
Original
2432 people have browsed it

The solution to jquery load Chinese garbled characters: first use editplus to create the [demo.txt] text; then save the text file [demo.txt] as [utf-8] format, and the Chinese will be displayed correctly.

How to deal with jquery load Chinese garbled characters

The operating environment of this tutorial: windows7 system, jquery3.2.1 version, DELL G3 computer.

Solution to jquery load Chinese garbled characters:

Recommendation: jquery video tutorial

Use editplus to create demo.txt (saved by ANSI),

$("#div1").load("demo.txt");
Copy after login

//div displays Chinese garbled characters

defined in html5<meta charset="utf-8"/>,Inconsistency in encoding and decoding causes garbled Chinese characters.

Save the text file demo.txt as utf-8 format. The Chinese text is displayed correctly. The problem is solved.

Related free Learning recommendation: js video tutorial

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template