77、标题栏显示时间

77、标题栏显示时间

脚本说明:

把如下代码加入<body>区域中:

 

<SCRIPT LANGUAGE="JavaScript">

<!-- Original:  陆晓庆(xiaoqinglu@263.net) -->

 

 

<!-- Begin

var clocktext;

var pagetitle = document.title;

function scroll() {

today = new Date();

sec = today.getSeconds();

hr = today.getHours();

min = today.getMinutes();

if (hr <= 9) hr = "0" + hr;

if (min <= 9) min = "0" + min;

if (sec <= 9) sec = "0" + sec;

var clocktext = " 现在时间是: " + hr + ":" + min + ":" + sec;

clocktimer = setTimeout("scroll()", 1000);

document.title = pagetitle + clocktext;

}

if (document.all) scroll();

//  End -->

</script>

 

Write a comment

Comments: 0