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

tag.innerHTML属性不生效
代码如下:
<%@   page   contentType= "text/html;   charset=gb2312 "   language= "java "   import= "java.sql.* "   errorPage= " "   %>
<!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>
</head>
<script   language= "javascript "   defer>
function   showTime(){
      var   nowDate=new   Date();  
      var   dayArray=new   Array( "星期日 ", "星期一 ", "星期二 ", "星期三 ", "星期四 ", "星期五 ", "星期六 ");
      var   monthArray=new   Array( "一月 ", "二月 ", "三月 ", "四月 ", "五月 ", "六月 ", "七月 ", "八月 ", "九月 ", "十月 ", "十一月 ", "十二月 ");
      var   year=nowDate.getYear();
      var   date=nowDate.getDate();
      var   hours=nowDate.getHours();
      var   minutes=nowDate.getMinutes();
      var   seconds=nowDate.getSeconds();
      var   suf= "AM ";
      if(hours> 12){
            suf= "PM ";
      }
      theTime= "今天是: "+year+ "年 "+monthArray[nowDate.getMonth()]+ " "+date+ "日 "+dayArray[nowDate.getDay()]+ "     北京时间: "+hours+ ": "+minutes+ ": "+seconds+ "     "+suf;
      is.innerHTML   =   "theTime ";
   
}        
</script>
<body>
<span   id= "is "> </span>
</body>
</html>
哪位大哥帮我看看,谢谢!!!

------解决方案--------------------
<!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>
</head>
<script language= "javascript " defer>
function showTime(){
var nowDate=new Date();
var dayArray=new Array( "星期日 ", "星期一 ", "星期二 ", "星期三 ", "星期四 ", "星期五 ", "星期六 ");
var monthArray=new Array( "一月 ", "二月 ", "三月 ", "四月 ", "五月 ", "六月 ", "七月 ", "八月 ", "九月 ", "十月 ", "十一月 ", "十二月 ");
var year=nowDate.getYear();
var date=nowDate.getDate();
var hours=nowDate.getHours();
var minutes=nowDate.getMinutes();
var seconds=nowDate.getSeconds();
var suf= "AM ";
if(hours> 12){
suf= "PM ";
}
theTime= "今天是: "+year+