hello.js

来自「基于WEB的会议管理系统」· JavaScript 代码 · 共 32 行

JS
32
字号
<!--
         today=new Date();
         function initArray(){
             this.length=initArray.arguments.length
             for(var i=0;i<this.length;i++)
               this[i+1]=initArray.arguments[i]  }
             var d=new initArray(
              "星期日",
              "星期一",
              "星期二",
              "星期三",
              "星期四",
              "星期五",
              "星期六");
              document.write(
               "<font color=#3399ff style='font-size:9pt;font-family: 宋体'> ",
               today.getYear(),"年",
               today.getMonth()+1,"月",
               today.getDate(),"日 ",
               d[today.getDay()+1],"   ",
               "</font>" );

now = new Date(),hour = now.getHours()
if(hour < 6){document.write  ( "<font color=#3399ff style='font-size:9pt;font-family: 宋体'> ", "起得早,身体好!","</font>") }
else if (hour < 8){document.write   (  "<font color=#3399ff style='font-size:9pt;font-family: 宋体'>", "全新的一天!","</font>") }
else if (hour < 12){document.write   (  "<font color=#3399ff style='font-size:9pt;font-family: 宋体'>", "早上好!","</font>") }
else if (hour < 13){document.write   ("<font color=#3399ff style='font-size:9pt;font-family: 宋体'>","现在是中午午休时间!","</font>") }
else if (hour < 18){document.write   ("<font color=#3399ff style='font-size:9pt;font-family: 宋体'>","下午好!","</font>")}
else if (hour < 22){document.write  ( "<font color=#3399ff style='font-size:9pt;font-family: 宋体'>","晚上好!","</font>") }
else if (hour < 24){document.write   ("<font color=#3399ff style='font-size:9pt;font-family: 宋体'>","夜深了! 要注意身体! 祝你做个好梦!","</font>")}

-->

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?