日期:2014-05-16  浏览次数:20297 次

为什么这个时钟界面跳不出来 帮忙找找错误在哪 3Q啦
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
var data=new Data();
var month=data.getMonth();
var day=data.getDate();
var year=data.getYear();
var hour=data.getHours();
var minutes=data.getMinutes();
month=month+1;
year=fixYear(year);
minutes=fixTime(minutes);
var data_string=month+"/"+day+"/"+year;
var time_string=hour+":"+minutes;
var data_time_string="Today is"+data_string+".The time is now"+time_string+".";

function fixYear(number){
if(number<1000) {
 number= number+1900;
 }
  return number;
  }
  function fixTime(number)
{if(number<10){
number="0"+number;
}
return number;
}
</script>

</head>
<body>
<h1>Welcome to the book of javascript home page</h1>
<script type="text/javascript">
  document.write(data_time_string);
 </script>
</body> 
</html>


------解决方案--------------------
new Data();写错了,应该是 
new Date();
------解决方案--------------------
number= number+1900;
还有这个中文分号