UTF-8 and Javascript

半腔热情 提交于 2019-12-19 06:43:59

问题


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:


The encoding of the files must be set to UTF8.



来源:https://stackoverflow.com/questions/6790593/utf-8-and-javascript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!