<!DOCTYPE?HTML>
<html>
<head>
<meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"?/>
<title>switch</title>
<script?type="text/JavaScript">
var?myweek?=3;//myweek表示星期幾變量
switch(myweek)
{
?case?1:
?case?2:
?document.write("學(xué)習(xí)理念知識(shí)");
?break;
?case?3:
?case?4:
?document.write("到企業(yè)實(shí)踐");
?break;
?case?5:
?document.write("總結(jié)經(jīng)驗(yàn)");
?break;
?case?6
?case?7
?document.write("周六、日休息和娛樂");
?break;
?default;
?document.write(data?error);
}
</script>
</head>
<body>
</body>
</html>
2016-12-16
document.write(data?error);
這句要加雙引號(hào)
document.write("data?error");