时钟,天气预报js

<div class="newsItem">
    
<script language="javascript" type="text/javascript">

<!--
var dayarray=new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六")
var montharray=new Array("01","02","03","04","05","06","07","08","09","10","11","12")
function getthedate(){
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year
+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym
="0"+daym
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()

var dn=""
if (minutes<=9)
minutes
="0"+minutes
if (seconds<=9)
seconds
="0"+seconds
var cdate="&nbsp;"+year+""+montharray[month]+""+daym+""+" "+dayarray[day]+" "+dn+" "+hours+":"+minutes+":"+seconds
if (document.all)
document.all.clock.innerHTML
=cdate
else
document.write(cdate)
}

if (!document.all)
getthedate()
function goforit(){
if (document.all)
setInterval(
"getthedate()",1000)
}

goforit();
//document.write("<span id=clock></span>");
-->
        
</script>
<br><span id="clock" name="clock"></span><iframe 
                                                     
border="0" frameborder="no" height="54" marginheight="0" marginwidth="0" scrolling="no"  allowTransparency="true" src="http://weather.265.com/weather.htm" width="200">
                                                    
</iframe>
posted @ 2007-12-25 23:37  曹振华  阅读(882)  评论(0编辑  收藏  举报