运行代码 缩小
汉王
HTML代码
复制 格式化 注释 注释 清空
放大
AخA
 
1
<html>
2
<head>
3
<title>在标题栏显示时间的Js</title>
4
<meta http-equiv="content-Type" content="text/html;charset=gb2312">  
5
</head>
6
<body>
7
看看窗口标题?是不是看到到了?
8
<script language="JavaScript">
9
var isMonth = new
10
Array("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月");
11
var isDay = new
12
Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日");
13
today = new Date () ;
14
Year=today.getYear();
15
Date=today.getDate();
16
if (document.all)
17
document.title="今天是: "+Year+"年"+isMonth[today.getMonth()]+Date+"日"+isDay[today.getDay()]
18
</script>
19
</body>
20
</html>
CSS代码
复制 格式化 注释 注释 颜色 清空
放大
CSS代码...
x
 
1
JS代码
复制 格式化 注释 注释 清空
放大
JS代码...
xxxxxxxxxx
1
 
1
名称
在IE的标题栏显示时间的Js
分类
日期时间
描述
在IE的标题栏显示日期和时间,在火狐下没有测试,应该也可以,如果不想显示时间,可以把这个日期函数去掉,直接用document.title就可以给一个标题栏赋予新值。
收藏