JSP显示系统时间
2012-02-23 09:33
211 查看
JSP页面中使用JavaScript获取系统时间,如下代码:
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <base href="<%=basePath%>"> <title>SysTime - www.cxybl.com</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <script language="JavaScript" type="text/javascript"> function showTime(){ var now=new Date; document.getElementById("dd").innerHTML=now.getFullYear() +"年"+(now.getMonth()+1) +"月"+now.getDate() +"日"+now.getHours() +":"+now.getMinutes()+":"+now.getSeconds(); setTimeout("showTime()","1000"); } </script> </head> <body onload="showTime()"> <div id=dd></div> </body> </html>
相关文章推荐
- jsp页面动态的显示当前系统的时间
- jsp和javascript显示系统时间
- JSP 页面动态的显示当前系统时间
- jsp中显示当前系统时间
- 在jsp页面上写js函数自动显示系统时间
- jsp实现页面实时显示当前系统时间的方法
- JSP显示当前系统时间的四种方式
- jsp页面实时显示当前系统时间方法
- jsp页面利用js动态显示当前系统时间
- my97datepicker控件 JSP页面打开默认显示系统当前时间
- jsp实现页面实时显示当前系统时间的方法
- javascript jsp页面动态显示系统时间 测试可用 多浏览器通过测试 (1)
- Struts2--使用JSP显示系统当前时间
- javascript jsp页面动态显示系统时间 测试可用 多浏览器通过测试 (2)
- jsp页面显示系统时间方法
- 两种jsp页面动态显示系统时间方法
- java显示系统的时间.jsp的复选框操作
- jsp动态显示系统时间页面
- JSP中实现动态显示系统时间
- 工作记录:系统顶端显示的当前时间