// 显示日期 function current(){ var d=new Date(),str=‘‘; var weekday=new Array(7) weekday[1]="星期一" weekday[2]="星期二" weekday[3]="星期三" weekday[4]="星期四" weekday[5]="星期五" weekday[6]="星期六" weekday[7]="星期日" str +=d.getFullYear()+‘年‘; //获取当前年份 str +=d.getMonth()+1+‘月‘; //获取当前月份(0——11) str +=d.getDate()+‘日‘; str +=‘ ‘+weekday[d.getDay()];//获取当前星期 return str; } setInterval(function(){$("#showtime").html(current)});