Chinese js code garbled, the solution is simple

Reference external JS, how to solve the Chinese garbled indeed

Figure

js Chinese garbled map

Solution

When introducing js, plus charset encoding format

<script charset="utf-8" src="skin/js/layer/layer.js"></script>

The following display

js Chinese normal renderings

If other sites, in the case you can not modify the source code

You can handle this, install the browser plug-in (where intense use of chrome, as a developer you know), plug-in

WEB front-end assistant (FeHelper)

When installing plug-ins, you need to FQ, and after installing the plug-in, right-click menu that appears in the browser corresponding functions in the following figure

Right-click menu

I chose utf-8, of course, you can choose other, you know show up correctly.

Guess you like

Origin www.cnblogs.com/shenenhua/p/11205217.html