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

Solution to garbled code problem in Js,alert_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:31:541125browse

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? …

Statement:
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