UTF-8 and Javascript

2020-03-17 03:50发布

I use Javascript to get data in a HTML pages define with a charset UTF8

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

my javascript method is load with a charset UTF8

<script type="text/javascript" charset="utf-8" src="../ressources/js/test.js"></script>

but i have a encode problem, when i get data with "innerHTML"

ex: salari�s

is there something I missed ?

1条回答
干净又极端
2楼-- · 2020-03-17 04:23

The encoding of the files must be set to UTF8.

查看更多
登录 后发表回答