抓狂了,到底哪里有问题??
<!DOCTYPE html>
<html>
<head>
<title>检查别人的代码</title>
<meta charset="utf-8">
<script type="text/javascript">
var mydate=new Date();
var myday=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
var mynum=mydate.getDay();
var myyear=mydate.getFullYear();
var mymonth=mydate.getMonth();
var myddate=mydate.getDate();
document.write(myyear+"年"+(mymonth+1)+"月"+myddate+"日"+myday[mynum]);
</script>
</head>
<body>
</body>
</html>
把整个完整的代码截图一下看看
据肉眼观察,你这一句有问题,var myday=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];,最后的分号你可能打成全角的了
和你的一样的,没有问题,那可能是那个标点或者符号打错了