リスト
| <script type="text/javascript"><!-- |
| myTbl = new Array( | // 行事テーブル(月,日,メッセージ) |
| 1, | 1, | "元旦", |
| 1, | 14, | "成人の日", |
| 2, | 11, | "建国記念の日", |
| 4, | 29, | "みどりの日", |
| 5, | 3, | "憲法記念日", |
| 5, | 4, | "国民の日", |
| 7, | 20, | "海の日", |
| 9, | 15, | "敬老の日", |
| 10, | 14, | "体育の日", |
| 11, | 3, | "文化の日", |
| 11, | 23, | "勤労感謝の日", |
| 12, | 23, | "天皇誕生日" |
| ); | |
| | |
| function myWrite(){ | |
| myMess = ""; | // メッセージ表示用 |
| myTblCnt = myTbl.length / 3; | // テーブルの数を取得/計算 |
| myD = new Date(); | // 現在の日付取得 |
| myMonth = myD.getMonth()+1; | // '月'取得 |
| myDate = myD.getDate(); | // '日'取得 |
| for(i=0; i<myTblCnt; i++){ | // テーブルの数だけループ |
| if (myTbl[i*3] == myMonth && myTbl[i*3+1] == myDate){ | // '月' と '日'が一致したら.. |
| myMess += "● " + myTbl[i*3+2] + "<BR>"; | // 行事メッセージ追加 |
| } | |
| } | |
| if ( myMess != "" ) document.getElementById( "info" ).innerHTML = myMess; | // 行事を表示 |
| } | |
| // --></script> | |
| |
| <DIV id="info">● 本日の行事は何もありません。</DIV> |
| <script type="text/javascript"><!-- |
| myWrite(); |
| // --></script> |
|