本文介绍了Javascript实现在标题栏上显示当前日期的方法,供大家参考,具体实现方法如下:

复制代码代码如下所示:

<!——

写的函数(){

/ / getdate

var现在=新日期();

VaR天=新的数组('sunday ','monday ','tuesday ','wednesday ','星期四',周五,'saturday);

VaR月=新的数组('january ','february ','march '四',愿,6月,'july ','august。

var date =((now.getdate()<10)0 )+ now.getdate();

/ / quadyear

函数2000(数字){返回(数字< 1000)编号+ 1900:数字;}

/ / glueit

今天now.getday =天{()} ++

月now.getmonth(){ } +

日期+

(Y2K(now.getyear()));

如果(document.all | |文件。getElementById){ / /浏览器检查

document.title = today.tostring();

其他{ }

self.status = today.tostring(默认); / /状态。

}

}

写();





希望本文能对大家的javascript程序设计有所帮助。