在<head>中加入

<meta http-equiv="Content-Type" content="text/html; charset=GB2312" />
引入js文件时加上 charset="UTF-8"