///pc/img/blank.gif" width="12" height="8">当前位置:///default.htm" class="under">亿度网络 -> ///pc/index.htm" class="under">网页制作教程 -> JavaScript
///pc/homepage/javascript/sample/img/bule.gif" width="207" height="13"> ///pc/homepage/javascript/sample/img/blank.gif" width="1" height="1"> ///pc/homepage/javascript/sample/img/js.gif" width="186" height="20"> ///pc/homepage/javascript/sample/img/blank.gif" width="1" height="1">
///pc/homepage/javascript/sample/img/blank.gif" width="1" height="1"> ///pc/homepage/javascript/sample/img/blank.gif" width="1" height="1">
    标题栏显示日期 ///pc/homepage/javascript/sample/img/blank.gif" width="1" height="1">  
    ///pc/homepage/javascript/sample/img/bule1.gif" width="28" height="49">  
效 果 演 示 ///pc/homepage/javascript/sample/img/bule2.gif" width="11" height="18">

  

    看看今天窗口上部的标题栏有没有变化?

   
 
源代码如下 ///pc/homepage/javascript/sample/img/bule2.gif" width="11" height="18">



这段程序放在<body>与</body>之间

   
源程序讲解: ///pc/homepage/javascript/sample/img/bule2.gif" width="11" height="18">
  ///pc/homepage/javascript/sample/img/bule1.gif" width="28" height="49">  

var isMonth = new Array
("1月","2月","3月","4月","5月","6月",
"7月","8月","9月","10月","11月","12月");
var isDay = new Array("星期日","星期一",
"星期二", "星期三", "星期四","星期五",
"星期六","星期日");
定义两个数组及其所包含的元素。
today = new Date () ;
Year=today.getYear();
Date=today.getDate();
获得当前的日期年份和日期。
if (document.all)
document.title="今天是: "+Year+"年"+
isMonth[today.getMonth()]+
Date+"日"+isDay[today.getDay()]
输出今天的日期和星期。



  ///pc/homepage/javascript/sample/img/blank.gif" width="1" height="1">  
 

 

网页制作 网页设计 网站建设 网站设计 网站制作 做网站 做网页