<!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=utf-8">
<title>无标题文档</title>
<script language="javascript">
function ndate()
{

var isnDay = ew Array ("星期一","星期二","星期三","星期四","星期五","星期六","星期日",);
var isnMonth = new Array('1月;,"2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月",);
today =new Date(); 
year=today.getYear();
Date=today.getDate();
if(document.all)
document.write(Year+"年"+isnMonth[today.getMonth()]+Date+"日"+isnDay[today.getDay()]);
}
</script>
</head><body>
<table>
 <tbody><tr>
  <td width="217px" height="22px">
    <script language="javascript">
  ndate();
</script>
  </td>
 </tr>
</tbody></table>
</body></html>

解决方案 »

  1.   

    请问 if(document.all) 是啥意思 , 还有请仔细检查一下你的js代码,你的数组赋值出现了很多细节问题啊,多了个逗号,还有分号……下面是我在你的代码基础上改的:
    <script type="text/javascript">
    var isnDay = new Array ("星期一","星期二","星期三","星期四","星期五","星期六","星期日");
    var isnMonth = new Array("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月");
    var today =new Date(); 
    year=today.getYear();
    date=today.getDate();
    document.write(year+"年"+isnMonth[today.getMonth()]+date+"日"+isnDay[today.getDay()]);
    </script>
      

  2.   

    <!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=utf-8">
    <title>无标题文档</title>
    <script language="javascript">
    function ndate()
    {

    var isnDay = new Array ("星期一","星期二","星期三","星期四","星期五","星期六","星期日");
    var isnMonth = new Array('1月',"2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月");
    today =new Date();  
    year=today.getYear();
    Date=today.getDate();
    if(document.all){
    document.write(year+"年"+isnMonth[today.getMonth()]+Date+"日"+isnDay[today.getDay()]);
    }

    }
    </script>
    </head>
    <body>
    <table>
    <tbody>
    <tr>
    <td width="217px" height="22px">
    <script language="javascript">
                              ndate();
                           </script>
    </td>
    </tr>
    </tbody>
    </table>
    </body>
    </html>