lord__icon
06-12-2003, 12:46 PM
OK
What Im trying to do is have a count down script
show up in alert on load
the script is
<script>
fuction countdown()
{
var before="All CRs should be 0"
var current="Today All Change Reuqest need be to 0"
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
function countdown(yr,m,d){
theyear=yr;themonth=m;theday=d
var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
if (todaym==5)
fmonth=90-todayd
if (todaym==6)
fmonth=60-todayd
if (todaym==7)
fmonth=29-todayd
if(fmonth==0&&todayh==0&&todaymin==0&&todaysec==1){
alert("All CRs Need To be to Zero")
return
}
else
alert(" Only "+fmonth+ " days, "+todayh+" hours, "+todaymin+" minutes, left until "+before)
return
}}
</script>
I have tryed
<body onLoad="countdown()">
how ever this does not work
also the page that this should happen to is in frames could this affect the on load and how could I go about making this happen thanks
What Im trying to do is have a count down script
show up in alert on load
the script is
<script>
fuction countdown()
{
var before="All CRs should be 0"
var current="Today All Change Reuqest need be to 0"
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
function countdown(yr,m,d){
theyear=yr;themonth=m;theday=d
var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
if (todaym==5)
fmonth=90-todayd
if (todaym==6)
fmonth=60-todayd
if (todaym==7)
fmonth=29-todayd
if(fmonth==0&&todayh==0&&todaymin==0&&todaysec==1){
alert("All CRs Need To be to Zero")
return
}
else
alert(" Only "+fmonth+ " days, "+todayh+" hours, "+todaymin+" minutes, left until "+before)
return
}}
</script>
I have tryed
<body onLoad="countdown()">
how ever this does not work
also the page that this should happen to is in frames could this affect the on load and how could I go about making this happen thanks