Home > Article > Web Front-end > What to do when jquery reads json garbled characters
When using [$.getJSON] to read the local json file, the Chinese content appears garbled. The solution to jquery reading json garbled code: re-save the local json file as [UTF-8].
The operating environment of this tutorial: windows7 system, jquery3.2.1 version, Dell G3 computer.
Recommended: jquery video tutorial
Solution to jquery reading json garbled code:
Read with $.getJSON When using a local json file, the Chinese content appears garbled
$.getJSON("/Content/config/RegularExpression.json", function (data) { });
Solution:
Resave the local json file as UTF-8
.
Related free learning recommendations: javascript (video)
The above is the detailed content of What to do when jquery reads json garbled characters. For more information, please follow other related articles on the PHP Chinese website!