1.第一种方法是自己在不知道第二种方法时的笨方法  用记事本打开js文件,点击文件-另存为 将编码方式改为自己需要的 比如utf-8。

2.第二种方法,点击eclipse中window -preferences   General-Content Types 点击后看到右边的Text  点击JavaScript source file 然后改变Default encoding  然后点击update按钮然后点ok  好了设置成功。