Copy语言代码:scriptlanguage=JavaScript
functionMakeArray(size)
this.len ...
Copy
语言代码:
<script language="JavaScript">
<!-- Hide
var timerID = null
var timerRunning = false
function MakeArray(size)
{
this.length = size;
for(var i = 1; i <= size; i++)
{ this[i] = ""; }
return this;
}
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 day = now.getDay();
var timeValue = "";
timeValue += year + "-";
timeValue += ((month < 10) ? "0" : "") + month + "-";
timeValue += date + " ";
timeValue += hours;
timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
timerID = setTimeout("showtime()",1000);
document.getElementById('datess').innerHTML=timeValue;
timerRunning = true
}
function startclock () {
stopclock();showtime()
}
//-->
</script>
应用: onLoad="startclock()"
document.getElementById('datess') 接收值..