asp.net网站前台显示当前日期的js代码

 <span class="style1">今天是:
          <script language="JavaScript">
<!---
   today=new Date();
  function initArray(){
  this.length=initArray.arguments.length
  for(var i=0;i<this.length;i++)
  this[i+1]=initArray.arguments[i]  }
  var d=new initArray("<font color=RED>星期日","<font color=white>星期一","<font color=white>星期二","<font color=white>星期三","<font color=white>星期四","<font color=white>星期五","<font color=GREEN>星期六");

  document.write(today.getYear(),"年",today.getMonth()+1,"月",today.getDate(),"日",d[today.getDay()+1]); 

//-->
         </script>
 </span>

posted @ 2011-08-11 07:55  风一样的大叔  阅读(244)  评论(0编辑  收藏  举报