Home > Web Front-end > JS Tutorial > body text

What to do if jquery reads json Chinese garbled characters

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

Cause: When using [$.getJSON] to read the local json file, the Chinese content appears garbled; the solution to jquery reading json Chinese garbled code: re-save the local json file as [UTF-8] That’s it.

What to do if jquery reads json Chinese garbled characters

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

Recommended: jquery video tutorial

##Solution to jquery reading json Chinese garbled code:

When using

$.getJSON to read the local json file, the Chinese content appears garbled

        $.getJSON("/Content/config/RegularExpression.json", function (data) {
           
        });
Copy after login

Solution:

Change the local json file Just save it again as UTF-8.

What to do if jquery reads json Chinese garbled characters

Related free learning recommendations:

javascript (video)

The above is the detailed content of What to do if jquery reads json 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