2005/06/11 | 网页代码——日期星期+走动时间
类别(网页制作) | 评论(1) | 阅读(584) | 发表于 19:38
<script language=javascript>
today=new Date();
function initArray(){
this.length=initArray.arguments.length
for(var i=0;i<this.length;i++)
this[i+1]=initArray.arguments[i] }
document.write("<font color=black>",today.getYear(),"<font color=black>年","<font color=black>",today.getMonth()+1,"<font color=black>月","<font color=black>",today.getDate(),"<font color=black>日 </FONT>");
var d=new initArray("<font color=RED>星期日","<font color=black>星期一","<font color=black>星期二","<font color=black>星期三","<font color=black>星期四","<font color=black>星期五","<font color=red>星期六");
</script>
</p></td>
</tr>
<tr>
<td width="100" height=25 valign=bottom> <p align=center>
<script
language=javascript>document.write(d[today.getDay()+1]);</script>
</p></td>
</tr>
<tr>
<td width="100" height=27> <p align=center> <span id="liveclock" style"=width: 109px; height: 15px"></span>
<script language=javascript>
function www_helpor_net()
{
var Digital=new Date()
var hours=Digital.getHours()
var minutes=Digital.getMinutes()
var seconds=Digital.getSeconds()
if(minutes<=9)
minutes="0"+minutes
if(seconds<=9)
seconds="0"+seconds
myclock=hours+":"+minutes+":"+seconds
if(document.layers){document.layers.liveclock.document.write(myclock)
document.layers.liveclock.document.close()
}else if(document.all)
liveclock.innerHTML=myclock
setTimeout("www_helpor_net()",1000)
}
www_helpor_net();
//-->
</script>

把这段代码加在网页代码的相应位置中即可实现.
0

评论Comments