Home > Web Front-end > JS Tutorial > Solution to garbled code problem in Js,alert_javascript skills

Solution to garbled code problem in Js,alert_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 17:31:54
Original
1240 people have browsed it

The js file that was still working normally a few days ago, after adding some things, the alert() pop-up prompt box was always garbled in Chinese. I read a lot on the Internet, and the answer was basically to add a < ;meta http-equiv="Content-Type" content="text/html;charset=gb2312" /> Or replace gb2312 with utf-8. I have tested it with various methods for a long time but still cannot solve this problem.

Solution:
Finally, I found something in a corner of a forum. It turns out that when referencing js files in HTML, you need to specify the encoding method of the character set. The specific method is . It’s strange, how come it wasn’t garbled before? …

Related labels:
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
Latest Issues
alert is not implemented yet
From 1970-01-01 08:00:00
0
0
0
javascript - Add alert to bootstrap popup layer
From 1970-01-01 08:00:00
0
0
0
alert("Hello JavaScript");
From 1970-01-01 08:00:00
0
0
0
Using $t in alert() for Vue’s i18n translation
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template