我的html中的js代码可以执行,但是我直接粘上的编码方式为什么还是输出乱码
我的代码<html><head><metahttp-equiv=Content-Typecontent="text/html;charset=utf-8"><script...
我的代码
<html><head> <meta http-equiv=Content-Type content="text/html;charset=utf-8"> <script language="javascript"> var now = new Date(); var year = now.getYear()+1900; var month = now.getMonth()+1; var data = now.getDate(); var day = now.getDay(); var arr_week = new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六"); var week = arr_week[day]; var time="当前时间:"+year+"年"+month+"月"+data+"日 "+week; alert(time); </script></head><body></body></html>
输出的结果求大神解答 展开
<html><head> <meta http-equiv=Content-Type content="text/html;charset=utf-8"> <script language="javascript"> var now = new Date(); var year = now.getYear()+1900; var month = now.getMonth()+1; var data = now.getDate(); var day = now.getDay(); var arr_week = new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六"); var week = arr_week[day]; var time="当前时间:"+year+"年"+month+"月"+data+"日 "+week; alert(time); </script></head><body></body></html>
输出的结果求大神解答 展开
1个回答
2016-05-11
展开全部
html里面要声明网页编码设置,如果声明了的话检查浏览器编码设置改成:自动获取
如果还是乱码,注意下你的html和js等文件的保存格式,要保存成你声明那个编码格式
如果还是乱码,注意下你的html和js等文件的保存格式,要保存成你声明那个编码格式
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询