馬光軍--------BLOG

          BlogJava 聯(lián)系 聚合 管理
            1 Posts :: 25 Stories :: 5 Comments :: 0 Trackbacks

          顯示動(dòng)態(tài)時(shí)間的頁(yè)面:

          <%@page contentType="text/html;charset=UTF-8"%>
          <%@include file="/WEB-INF/jsp/common/forward_portal.jsp"%>
          <%@include file="/WEB-INF/jsp/common/meta.jsp"%>
          <%@include file="/WEB-INF/jsp/common/taglibs.jsp"%>
          <html>
              
          <head>
                  
          <title>top</title>
                  
          <link href="css/infopush_portal.css" rel="stylesheet" type="text/css">
                  
          <script src="js/datagather/infopush/dateTime.js" type="text/javascript"></script>
              
          </head>
              
          <body>
                  
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      
          <tr height="27">
                          
          <td background="images/doc/time_bg.jpg">
                              
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                  
          <tr>
                                      
          <td width="36%" align="center">
                                          登錄用戶:${ sessionScope.userName}
                                      
          </td>
                                      
          <td width="32%">
                                          所屬組織:${ sessionScope.orgName}
                                      
          </td>
                                      
          <td id="time">
                                            
          <script>showTime(time)</script>
                                      
          </td>
                                  
          </tr>
                              
          </table>
                          
          </td>
                      
          </tr>
                      
          <tr>
                          
          <td>
                              
          <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
                                  codebase
          ="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"
                                  width
          ="991" height="109">
                                  
          <param name="movie" value="images/infopush/infopushtop.swf">
                                  
          <param name="quality" value="high">
                                  
          <embed src="images/infopush/infopushtop.swf" quality="high"
                                      pluginspage
          ="http://www.macromedia.com/go/getflashplayer"
                                      type
          ="application/x-shockwave-flash" width="991" height="109"></embed>
                              
          </object>
                          
          </td>
                      
          </tr>
                      
          <tr height="26">
                          
          <td bgcolor="#84b5fd">
                              
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                  
          <tr>
                                      
          <td width="189">
                                          
          <img src="images/file/systemname.jpg" width="189" height="26" />
                                      
          </td>
                                      
          <td align="center"></td>
                                  
          </tr>
                              
          </table>
                          
          </td>
                      
          </tr>
                  
          </table>
              
          </body>
          </html>

          dateTime.js代碼如下:
          function showTime(element) {
              var date1 = new Date();
              var year1 = date1.getYear();
              var month1 = date1.getMonth() + 1;
              var day1 = date1.getDay(); 
              var daydate = date1.getDate();
              var hour1 = date1.getHours();
              var minute1 = date1.getMinutes();
              var second1 = date1.getSeconds();
              var temp;
              if (hour1 
          < "10") {
                  hour1 
          = "0" + hour1;
              }
              if (minute1 < "10") {
                  minute1 
          = "0" + minute1;
              }
              if (second1 < "10") {
                  second1 
          = "0" + second1;
              }
              switch (day1) {
                case 0:
                  temp 
          = "星期日";
                  break;
                case 1:
                  temp 
          = "星期一";
                  break;
                case 2:
                  temp 
          = "星期二";
                  break;
                case 3:
                  temp 
          = "星期三";
                  break;
                case 4:
                  temp 
          = "星期四";
                  break;
                case 5:
                  temp 
          = "星期五";
                  break;
                case 6:
                  temp 
          = "星期六";
                  break;
              }
              element.innerHTML 
          = "今天是:"+year1 + "年" + month1 + "月" + daydate + "日" +" "+ temp;
              element.innerHTML 
          = "今天是:"+year1 + "年" + month1 + "月" + daydate + "日" +" "+ temp + " " + hour1 + ":" + minute1 + ":" + second1;
              window.setTimeout("showTime(" + element.id + ")", 1000);
          }

          兩個(gè)文件一整合,就能看見(jiàn)動(dòng)態(tài)的時(shí)間。
          posted on 2008-12-02 20:47 馬光軍 閱讀(86) 評(píng)論(0)  編輯  收藏

          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 乌拉特后旗| 东平县| 黄龙县| 隆林| 含山县| 洛阳市| 历史| 凌源市| 武冈市| 招远市| 万州区| 西宁市| 陇西县| 安多县| 台南市| 昌宁县| 衡山县| 类乌齐县| 娱乐| 稻城县| 阜新市| 门源| 隆回县| 隆化县| 通城县| 蛟河市| 彭山县| 怀仁县| 太湖县| 乌鲁木齐市| 信丰县| 新兴县| 马尔康县| 原平市| 天门市| 肃宁县| 呼玛县| 安图县| 晋江市| 樟树市| 五河县|