在状态栏显示时间,高手帮看下哪里错误!
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN " "http://www.w3.org/TR/html4/loose.dtd ">
<html>
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=UTF-8 ">
<title> Insert title here </title>
<script type= "text/javascript ">
//该函数将在状态栏显示时间
//一旦调用该函数就会激活时钟,此后它将自己调用自己
function display_time_in_status_line(){
var d = new Date();
var h = d.getHours();
var m = d.getMinuses();
var ampm = (h> =12)? "PM "; "AM ";
if (h > 12) h = h-12;
if (m < 10) m = "0 " + m;
var t = h + ": " + m + " " +ampm;
defaultStatus = t;
setTimeout( "display_time_in_status_line() ",6000);
}
</script>
</head>
<body onload= "display_time_in_status_line{}; ">
</body>
</html>
提示: <body onload= "display_time_in_status_line{}; "> 中缺少“;”号。
------解决方案--------------------3元表达式写错了
? :
问号,然后是冒号,不是分号