java脚本变量case问题
实例:<script type="text/javascript"> //You will receive a different greeting based //on what day it is. Note that Sunday=0, //Monday=1, Tuesday=2, etc. var d=new Date() theDay=d.getDay() switch (theDay) { case 5: document.write("Finally Friday") break case 6: document.write("Super Saturday") break case 0: document.write("Sleepy Sunday") break default: document.write("I'm looking forward to this weekend!") } </script>中的case5,6什么的,开头也没定义啊??在这里是什么用途呢
答案:
看看这个
JavaScript中getDay日期函数 http://www.ijavascript.cn/shouce/javascript-getday-197.html如果星期五就命中case 5, 星期六就命中case 6.
上一个:<急>脚本怎么调试?
下一个:易语言如何获取js脚本加载完毕后的HTML