View Single Post
  #1   IP: 117.95.49.183
Old 2013-02-27, 05:53 PM
topvip topvip is offline
超级版主
 
Join Date: 2006-01-04
Posts: 1206
topvip 正向着好的方向发展
Default 首页导航位置如何显示日期时间呢!

head区域插入以下JS代码


<script language="javascript" type="text/javascript">
window.onload=function (){
setInterval("document.getElementById('time').innerHTML=new Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt(new Date().getDay());",1000);
}
</script>


然后在需要显示的位置加入 <span id="time" class="time"></span>

织梦默认的head模板已经存在<span id="time" class="time"></span>
Reply With Quote