| アクセスした時間により違うメッセージを表示 | ||||
| Sample |
| スクリプト |
| <SCRIPT language="JavaScript">
<!-- today = new Date() year = today.getYear() minutes = today.getMinutes() if(today.getYear() < 2000) { year = "19" + year} if(today.getMinutes() < 10) { minutes = "0" + minutes} if((today.getHours() > 0) && (today.getHours() <= 3)) { document.write("<FONT SIZE=3 color=#000000>夜も更けてまいりましたお休みなさい(=_=)zzzzz</FONT><BR>")} if((today.getHours() > 3) && (today.getHours() <= 5)) { document.write("<FONT SIZE=3 color=#999999>もうすぐ夜明けです。</FONT><BR>")} if((today.getHours() > 5) && (today.getHours() <= 10)) { document.write("<FONT SIZE=3 color=#0000FF>おはようございます!!</FONT><BR>")} if((today.getHours() > 10) && (today.getHours() <= 11)) { document.write("<FONT SIZE=3 color=#009FFF>こんにちは!</FONT><BR>")} if((today.getHours() == 11)) { document.write("<FONT SIZE=3 color=#FF0000>もうすぐお昼ですよ。(^_^)</FONT><BR>")} if((today.getHours() == 12)) { document.write("<FONT SIZE=3 color=#FF0000>お昼ですよ。今日は何を食べてますか。 </FONT><BR>")} if((today.getHours() > 11) && (today.getHours() <= 12)) { document.write("<FONT SIZE=3 color=#00FF00>お昼の一時いかがお過ごしですか</FONT><BR>")} if((today.getHours() > 12) && (today.getHours() < 17)) { document.write("<FONT SIZE=3 color=#FFAA00>こんにちは!</FONT><BR>")} if((today.getHours() > 15) && (today.getHours() <= 18)) { document.write("<FONT SIZE=3 color=#009900>今晩のおかずはなんでしょう?</FONT><BR>")} if((today.getHours() >= 18) && (today.getHours() <= 23)) { document.write("<FONT SIZE=3 color=#FF0000>こんばんは。</FONT><BR>")} if((today.getHours() > 23) && (today.getHours()< 8)) { document.write("<FONT SIZE=3 color=#FF00FF>テレホーダイの時間です。</FONT><BR>")} document.write("<FONT SIZE=3 color=#0000FF>今日は",year,"年",today.getMonth()+1,"月",today.getDate(),"日 / ") document.write("<FONT SIZE=3 color=#0000FF>只今の時間は",today.getHours(),"時",minutes,"分です。","<BR></FONT>") // --> </SCRIPT> |