天空是蓝色的

做好软件为中国 #gcc -c helloworld.c -o helloworld.o //编译目标文件 #gcc helloworld.o -o helloworld //编译成可执行exe #helloworld //运行exe
数据加载中……
自动刷新页面取客户端时间并给URL参数赋值

 

 1<html>
 2<head>
 3<title>自动刷新页面取客户端时间</title>
 4</head>
 5<body>
 6<href="test.html" id="selfLink"/>
 7<script lang="javascript">
 8
 9function refresh() {
10var date = new Date();
11Hour = date.getHours();
12Minute = date.getMinutes();
13Second = date.getSeconds();
14Year = date.getYear();
15Month = date.getMonth()+1;
16Day = date.getDate();
17var dateFormat = Year+"-"+Month+"-"+Day+" "+Hour+":"+Minute+":"+Second;
18window.open(document.getElementById('selfLink').href + "?"+dateFormat,"_self");    
19}

20
21setTimeout("refresh()"5000);
22
</script>
23</body>
24</html>

posted on 2005-11-16 15:50 bluesky 阅读(828) 评论(0)  编辑  收藏 所属分类: HTML/CSS


只有注册用户登录后才能发表评论。


网站导航: