照着敲都输不出,这是为什么?
<!doctype html>
<html>
<head>
<title>日期</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
var date=new Date();
var timeStr='';
timeStr=date.getFullYear()+"年";
timeStr+=date.getMonth()+1+"月";
timeStr+=date.getDate()+"日";
var day=date.getDay();
var week='';
switch(day){
case 0:week='星期天';
break;
case 1:week='星期一';
break;
case 2:week='星期二';
break;
case 3:week='星期三';
break;
case 4:week='星期四';
break;
case 5:week='星期五';
break;
case 6:week='星期六';
break;
}
timeStr+=" "+week;
document.write(timeStr);
</script>
</head>
<body>
</body>
</html>