Dupa ce am inteles problema cu neincaracarea elementelor din pagina am incercat sa rezolv astfel:
Cod: Selectaţi tot
<html>
<head>
<title>Countdown Clock</title>
<script type="text/javascript">
new Date("yyyy,mm,dd,hh:mm:ss");
var data=new Date("2010,10,14,6:45:23")
var d=new Date();
var sec=data.getSeconds()-d.getSeconds();
if(sec<0)
{
sec=60+sec;
data.setMinutes(data.getMinutes()-1);
}
var min=data.getMinutes()-d.getMinutes();
if(min<0)
{
min=60+min;
data.setHours(data.getHours()-1);
}
var hours=data.getHours()-d.getHours();
if(hours<0)
{
hours=24+hours;
data.setDate(data.getDate()-1);
}
var days=data.getDate()-d.getDate();
if(days<0)
{
days=30+days;
data.setMonths(data.getMonths()-1);
}
onload=function count(days,hour,min,sec)
{
if(sec>=0)
{
document.getElementById("seconds").innerHTML=sec + "seconds";
sec--;
}
else
if(min>0)
{
document.getElementById("seconds").innerHTML='59 seconds';
min--;
document.getElementById('minutes').innerHTML=minutes + "minutes";
sec--;
}
else
if(hours>0)
{
hours--;
document.getElementById('hours').innerHTML=hours + "hours";
document.getElementById('minutes').innerHTML='59 minutes';
document.getElementById('seconds').innerHTML='59 seconds';
sec--;
}
else
if(days>0)
{
days--;
document.getElementById('days').innerHTML=days + "days";
document.getElementById('hours').innerHTML= "23 hours";
document.getElementById('minutes').innerHTML='59 minutes';
document.getElementById('seconds').innerHTML='59 seconds';
sec--;
}
else
{
document.write("Numaratoarea a luat sfarsit!!!");
return ;
}
setTimeout("count(days,hours,min,sec)",1000);
}
</script>
<link rel="stylesheet" href="style.css" type="text/css"/>
</head>
<body>
<script type="text/javascript">
count(days,hours,min,sec);
</script>
<div id="clock">
<div id="days">
1000 days
</div>
<div id="hours">
23 hours
</div>
<div id="minutes">
56 minutes
</div>
<div id="seconds">
23 seconds
</div>
</div>
</body>
</html>
Daca ai timp te rog sa arunci o privire peste cod si sa imi explici ce e gresit.