生成一个网页内嵌一个flash时钟显示系统时间
时间: 2024-05-21 07:10:36 浏览: 17
<!DOCTYPE html>
<html>
<head>
<title>Flash时钟显示系统时间</title>
<meta http-equiv="refresh" content="1"> <!--每1秒刷新一次页面-->
</head>
<body>
<object type="application/x-shockwave-flash" data="clock.swf" width="100" height="100">
<param name="movie" value="clock.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#ffffff">
</object>
<script type="text/javascript">
function getTime() {
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
hours = checkTime(hours);
minutes = checkTime(minutes);
seconds = checkTime(seconds);
var timeString = hours + ":" + minutes + ":" + seconds;
return timeString;
}
function checkTime(i) {
if (i < 10) {
i = "0" + i;
}
return i;
}
var clock = document.getElementsByTagName("object")[0];
clock.innerHTML = getTime();
</script>
</body>
</html>
相关推荐
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)