jsp页面利用JS做即时时间显示

想给系统多些点缀,顺便把知识点温习一遍,不过讲真,这些都是网上扒的!我的水平现在也就这样
<%@page import="javax.xml.crypto.Data"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ page import="java.util.Date" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.STYLE1 {
font-size: 12px;
color: #FFFFFF;
}
.STYLE2 {font-size: 9px}
.STYLE3 {
color: #033d61;
font-size: 12px;
}
-->
</style>
<!-- <script type="text/javascript">
setInterval("document.getElementById('time1')").innerHTML=new Date().toL; </script> -->
<%-- <%
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date currentTime = new Date();
String time=sdf.format(currentTime).toString();
%> --%>
<script type="text/javascript" src="../js/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
function time() {
var date = new Date();
var year = date.getFullYear();
var month = date.getMonth()+1;
var day = date.getDate();
var house = date.getHours();
var minutes = date.getMinutes();
var second = date.getSeconds();
var milsecond = date.getMilliseconds();
document.getElementById("showtime").innerHTML = year + "-" + month + "-" + day + " " + house + ":" + minutes + ":" + second ; setTimeout("time()", 100);
} </script>
</head> <body onload="time(),find()"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="70" background="../images/main_05.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="24"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="270" height="24" background="../images/main_03.gif"> </td>
<td width="505" background="../images/main_04.gif"> </td>
<td> </td>
<td width="21"><img src="../images/main_07.gif" width="21" height="24"></td>
</tr>
</table></td>
</tr>
<tr>
<td height="38"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="270" height="38" background="../images/main_09.gif"> </td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="77%" height="25" valign="bottom"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50" height="19"><div align="center"><!-- <img src="../images/main_12.gif" width="49" height="19"> --></div></td>
<td width="50"><!-- <div align="center"><img src="../images/main_14.gif" width="48" height="19"></div> --></td>
<td width="50"><!-- <div align="center"><img src="../images/main_16.gif" width="48" height="19"></div> --></td>
<td width="50"><!-- <div align="center"><img src="../images/main_18.gif" width="48" height="19"></div> --></td> <td width="26"><div align="center"><img src="../images/main_21.gif" width="26" height="19"></div></td>
<td width="100"><div align="center"><img src="../images/main_22.gif" width="98" height="19"></div></td>
<td> </td>
</tr>
</table></td>
<td width="50"><div align="center"><span class="STYLE1" id="logout">退出
</span>
</div>
</td>
<td width="220" valign="bottom" nowrap="nowrap">
<div align="right" >
<span class="STYLE1" id="showtime">
</span>
</div>
</td>
</tr>
</table></td>
<td width="21"><img src="../images/main_11.gif" width="21" height="38"></td>
</tr>
</table></td>
</tr>
<tr>
<td height="8" style=" line-height:8px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="270" background="../images/main_29.gif" style=" line-height:8px;"> </td>
<td width="505" background="../images/main_30.gif" style=" line-height:8px;"> </td>
<td style=" line-height:8px;"> </td>
<td width="21" style=" line-height:8px;"><img src="../images/main_31.gif" width="21" height="8"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="28" background="../images/main_36.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="177" height="28" background="../images/main_32.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20%" height="22"> </td>
<td width="59%" valign="bottom"><div align="center" class="STYLE1">当前用户:Admin</div></td>
<td width="21%"> </td>
</tr>
</table></td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="65" height="28"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="23" valign="bottom"><table width="58" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="20" style="cursor:hand" onMouseOver="this.style.backgroundImage='url(../images/bg.gif)';this.style.borderStyle='solid';this.style.borderWidth='1';borderColor='#a6d0e7'; "onmouseout="this.style.backgroundImage='url()';this.style.borderStyle='none'"> <div align="center" class="STYLE3">业务中心</div></td>
</tr>
</table></td>
</tr>
</table></td>
<td width="3"><img src="../images/main_34.gif" width="3" height="28"></td>
<td width="63"><table width="58" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="20" style="cursor:hand" onMouseOver="this.style.backgroundImage='url(../images/bg.gif)';this.style.borderStyle='solid';this.style.borderWidth='1';borderColor='#a6d0e7'; "onmouseout="this.style.backgroundImage='url()';this.style.borderStyle='none'"><div align="center" class="STYLE3">系统管理</div></td>
</tr>
</table></td>
<td width="3"><img src="../images/main_34.gif" width="3" height="28"></td>
<td width="63"><table width="58" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="20" style="cursor:hand" onMouseOver="this.style.backgroundImage='url(../images/bg.gif)';this.style.borderStyle='solid';this.style.borderWidth='1';borderColor='#a6d0e7'; "onmouseout="this.style.backgroundImage='url()';this.style.borderStyle='none'"><div align="center" class="STYLE3">通讯录</div></td>
</tr>
</table></td>
<td width="3"><img src="../images/main_34.gif" width="3" height="28"></td>
<td width="63"><table width="58" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="20" style="cursor:hand" onMouseOver="this.style.backgroundImage='url(../images/bg.gif)';this.style.borderStyle='solid';this.style.borderWidth='1';borderColor='#a6d0e7'; "onmouseout="this.style.backgroundImage='url()';this.style.borderStyle='none'"><div align="center" class="STYLE3">数据管理</div></td>
</tr>
</table></td>
<td width="3"><img src="../images/main_34.gif" width="3" height="28"></td>
<td width="63"><table width="58" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="20" style="cursor:hand" onMouseOver="this.style.backgroundImage='url(../images/bg.gif)';this.style.borderStyle='solid';this.style.borderWidth='1';borderColor='#a6d0e7'; "onmouseout="this.style.backgroundImage='url()';this.style.borderStyle='none'"><div align="center" class="STYLE3">统计报表</div></td>
</tr>
</table></td>
<td width="3"><img src="../images/main_34.gif" width="3" height="28"></td>
<td width="63"><table width="58" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="20" style="cursor:hand" onMouseOver="this.style.backgroundImage='url(../images/bg.gif)';this.style.borderStyle='solid';this.style.borderWidth='1';borderColor='#a6d0e7'; "onmouseout="this.style.backgroundImage='url()';this.style.borderStyle='none'"><div align="center" class="STYLE3">业务管理</div></td>
</tr>
</table></td>
<td width="3"><img src="../images/main_34.gif" width="3" height="28"></td>
<td width="63"><table width="58" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="20" style="cursor:hand" onMouseOver="this.style.backgroundImage='url(../images/bg.gif)';this.style.borderStyle='solid';this.style.borderWidth='1';borderColor='#a6d0e7'; "onmouseout="this.style.backgroundImage='url()';this.style.borderStyle='none'"><div align="center" class="STYLE3">系统配置</div></td>
</tr>
</table></td>
<td width="3"><img src="../images/main_34.gif" width="3" height="28"></td>
<td width="63"><table width="58" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="20" style="cursor:hand" onMouseOver="this.style.backgroundImage='url(../images/bg.gif)';this.style.borderStyle='solid';this.style.borderWidth='1';borderColor='#a6d0e7'; "onmouseout="this.style.backgroundImage='url()';this.style.borderStyle='none'"><div align="center" class="STYLE3">升级维护</div></td>
</tr>
</table></td>
<td> </td>
</tr>
</table></td>
<td width="21"><img src="../images/main_37.gif" width="21" height="28"></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
jsp页面利用JS做即时时间显示的更多相关文章
- js获取当前时间显示在页面上
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...
- 使用监听器解决路径问题,例如在jsp页面引入js,css的web应用路径
使用监听器解决路径问题,例如在jsp页面引入js,css的web应用路径 经常地,我们要在jsp等页面引入像js,css这样的文件,但是在服务器来访问的时候,这时间就有关到相对路径与绝对路径了.像网页 ...
- jsp 自定义标签解决jsp页面中int时间戳的时间格式化问题
jsp 自定义标签解决jsp页面中int时间戳的时间格式化问题 之前在项目中根据需求,需要自定义标签,经过查询w3c文档,自己也踩了一些坑,特此记录自定义标签的步骤,下面就以我之前的一个例子中的定义一 ...
- jsp页面:js方法里嵌套java代码(是操作数据库的),如果这个js 方法没被调用,当jsp页面被解析的时候,不管这个js方法有没有被调用这段java代码都会被执行?
jsp页面:js方法里嵌套java代码(是操作数据库的),如果这个js 方法没被调用,当jsp页面被解析的时候,不管这个js方法有没有被调用这段java代码都会被执行? 因为在解析时最新解析的就是JA ...
- jsp页面和js代码中使用sessionScope获取session值
场景:有些实体对象可以放到HttpSession对象中,保正在一个会话期间可以随时获取这个对象的属性,例如可以将登录用户的信息写入session,以保证页面随时可以获取并显示这个用户的状态信息.下面以 ...
- 如何将数据库中的值经过servlet传入到jsp页面,并且用EL表达式显示出值
方法一:通过id查询某一数据库表中具体的行,将值封装在相应的对象中,如下面的对象Notice servlet中 String noticeId=request.getParameter("n ...
- 利用JS获取本地时间和服务器时间
<p id="labTime"> <script type="text/javascript"> //取客户端时间 setInterva ...
- 2017.11.9 如何利用JS做登陆验证界面
()案例----JavaScript实现输入验证 需要验证的表单输入域和要求 用户名不能为空,是否符合规定的格式 密码长度是否超过6,两次密码输入一致 邮箱地址:邮箱地址必须符合邮箱形式 ~~~注意提 ...
- 在JSP页面中输出完整的时间
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding= ...
随机推荐
- SQL Server中利用正则表达式替换字符串
--如果存在则删除原有函数 IF OBJECT_ID(N'dbo.RegexReplace') IS NOT NULL DROP FUNCTION dbo.RegexReplace G ...
- tengine 增加ngx_http_cache_purge_module 模块
wget http://labs.frickle.com/files/ngx_cache_purge-2.1.tar.gz tar zxvf ngx_cache_purge-2.1.tar.gz -- ...
- window函数 resetAccumulator
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreem ...
- mysql创建唯一索引
查看索引 show index from 数据库表名 alter table 数据库add index 索引名称(数据库字段名称) PRIMARY KEY(主键索引) ALTER TABLE `ta ...
- angular.js测试框架protracotr安装所需的node版本
protractor内代码的语法是基于ES6的,比如:里面用到了展开运算符“...”,node.js 6.0以下是不支持该语法特性. 所以,安装protractor是不会报错,但运行webdriver ...
- python argparse详解
1.argparse模块作用 用于解析命令行参数 2.位置参数和可选参数 运行以下代码: import argparse parser = argparse.ArgumentParser() args ...
- Android 编程下string-array 的使用
在实际开发中,当数据为固定数据.数据量不是很大.希望很方便的获取到这些数据的时候,可以考虑使用这种低成本的方式来获取预装数据.将想要保存的数据存储到 values 文件夹下的 arrays.xml 文 ...
- 有了#ifdef 为什么还需要#if defined
有了#ifdef 为什么还需要#if defined ? #include <stdio.h> #define A #define B void test(int a,int b) { ...
- jdbc连接sqlserver报错java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver
使用2008的数据库, 我已经引入的sqljdbc4的包,单还是报这个错,很奇怪突然想到在配置hibernate的时候,是拷贝下来的代码 然后到网上查了下, 因为是2008的版本驱动和2000的有点不 ...
- ARKit从入门到精通(10)-ARKit让飞机绕着你飞起来
1.1-ARKit物体围绕相机旋转流程介绍 1.2-完整代码 1.3-代码下载地址 废话不多说,先看效果 其实是会一直围着你转圈的,只不过笔者不好意思暴露家里的场景,所以请读者朋友们见谅~ 由于是晚上 ...