这个脚本只会显示年份和季节 - 中国WEB开发者网络 (http://www.webasp.net) -- 网页特效 (http://www.webasp.net/javascript/) --- 这个脚本只会显示年份和季节 (http://www.webasp.net/javascript/1/21.htm) |
| -- 发布日期: 2004-05-24 |
| <!-- 网页特效代码由[中国WEB开发者网络:http://www.ChinaWebDev.com]提供! --> <!-- 要实现此效果需要 1 个步骤: --> <!-- 第 1 步: --> <!-- 把下面的代码加到<BODY></BODY>区域中: --> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin var now = new Date(); var month = now.getMonth() + 1; var date = now.getDate(); var year = now.getYear(); var season; if (month > 1 && month <= 3) season = "冬季"; if (month == 3 && date > 19) season = "春季"; if (month > 3 && month <= 6) season = "春季"; if (month == 6 && date > 20) season = "夏季"; if (month > 6 && month <= 9) season = "夏季"; if (month == 9 && date > 21) season = "秋季"; if (month > 9 && month <= 12) season = "秋季"; if (month == 12 && date > 20) season = "冬季"; //Y2K Fix if (year < 2000) year = year + 1900; //Winter Season Fix if (season == "Winter") year = year - 1; document.write(year + "年 " + season); // End --> </script> |
| webasp.net |