如何将这段JAVA代码加入到状态栏中显示

来源:百度知道 编辑:UC知道 时间:2024/05/10 12:26:25
这段代码让它在状态栏中显示,各位大虾帮忙写写。是一个关于动态时间的
忘了代码了,是这个
<div id=time>?</div>
<script>
function show()
{
now=new Date();
year=now.getYear();
month=now.getMonth()+1;
date=now.getDate();
hours=now.getHours();
minutes=now.getMinutes();
seconds=now.getSeconds();
if(minutes<=9)
minutes="0"+minutes
if(seconds<=9)
seconds="0"+seconds
time.innerHTML=year+"年"+month+"月"+date+"日"+"现在时间:"+hours+":"+minutes+":"+seconds;

setTimeout("show()",1000);
}
show();
</script>

LS 真毒,直接把我的代码拷过来
都不看人家 问的是什么 题目。鄙视。。

可以试下 这个
把<script> </script> 代码 放到 <head></head>就行了

底下代码 保存后 可以直接预览

<HTML>
<HEAD>
<TITLE> New Document2 </TITLE>

<script Language="JavaScript">
var timerID = null;
var timerRunning = false;
function stopclock (){
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
function showtime () {

var now = new Date();
var year=now.getYear();
var month=now.getMonth()+1;
var date=now.getDate();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds()
var timeValue = "" +year+"年"+month+"月"+date+"日"+" "+"现在时间:"+ ((hours >12) ? hours -12 :hours)
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeVa