社区
Web 开发
帖子详情
jsp页面上,怎样动态的显示时间?????
jinqinghai
2004-09-22 04:05:02
jsp页面上,怎样动态的显示时间?????
...全文
324
7
打赏
收藏
jsp页面上,怎样动态的显示时间?????
jsp页面上,怎样动态的显示时间?????
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
7 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
香芋元宇宙
2004-09-22
打赏
举报
回复
真棒,收藏了
jinqinghai
2004-09-22
打赏
举报
回复
楼上2位的方法都不错,记下了
xunyiren
2004-09-22
打赏
举报
回复
<div id="dynatime"> </div>
<SCRIPT LANGUAGE="JavaScript">
<!--
dynatime.innerText=new Date().toLocaleString();
window.setInterval("dynatime.innerText=new Date().toLocaleString()",1000)
//-->
</SCRIPT>
gjd111686
2004-09-22
打赏
举报
回复
http://blog.csdn.net/gjd111686/archive/2004/07/16/42852.aspx
利用JavaScript生成图片时钟
<script>
n0=
"#define t_width 3\n"
+"#define t_height 5\n"
+"static char t_bits[]={0xF,0x5,0x5,0x5,0xF}";
n1=
"#define t_width 3\n"
+"#define t_height 5\n"
+"static char t_bits[]={0x4,0x4,0x4,0x4,0x4}";
n2=
"#define t_width 3\n"
+"#define t_height 5\n"
+"static char t_bits[]={0xF,0x4,0xF,0x1,0xF}";
n3=
"#define t_width 3\n"
+"#define t_height 5\n"
+"static char t_bits[]={0xF,0x4,0xF,0x4,0xF}";
n4=
"#define t_width 3\n"
+"#define t_height 5\n"
+"static char t_bits[]={0x5,0x5,0xF,0x4,0x4}";
n5=
"#define t_width 3\n"
+"#define t_height 5\n"
+"static char t_bits[]={0xF,0x1,0xF,0x4,0xF}";
n6=
"#define t_width 3\n"
+"#define t_height 5\n"
+"static char t_bits[]={0xF,0x1,0xF,0x5,0xF}";
n7=
"#define t_width 3\n"
+"#define t_height 5\n"
+"static char t_bits[]={0xF,0x4,0x4,0x4,0x4}";
n8=
"#define t_width 3\n"
+"#define t_height 5\n"
+"static char t_bits[]={0xF,0x5,0xF,0x5,0xF}";
n9=
"#define t_width 3\n"
+"#define t_height 5\n"
+"static char t_bits[]={0xF,0x5,0xF,0x4,0xF}";
nD=
"#define t_width 3\n"
+"#define t_height 5\n"
+"static char t_bits[]={0x0,0x0,0xF,0x0,0x0}";
nS=
"#define t_width 3\n"
+"#define t_height 5\n"
+"static char t_bits[]={0x0,0x0,0x0,0x0,0x0}";
nT=
"#define t_width 3\n"
+"#define t_height 5\n"
+"static char t_bits[]={0x0,0xF,0x0,0xF,0x0}";
function setImg()
{
var now=new Date();
var month=now.getMonth()+1;
var strNow=strFormat(""+now.getYear(),4)+"D"+strFormat(""+month,2)+"D"+strFormat(""+now.getDate(),2)+"S"+strFormat(""+now.getHours(),2)+"T"+strFormat(""+now.getMinutes(),2)+"T"+strFormat(""+now.getSeconds(),2)+"T"+strFormat(""+now.getMilliseconds(),3);
ClockID.innerHTML="";
var vImg="";
for(iInde=0;iIndex<strNow.length;iIndex++)
{
vImg=vImg+"<img src=\"javascript:n"+strNow.substr(iIndex,1)+";\" width=\"9\" height=\"15\">\n";
ClockID.innerHTML=vImg;
}
}
function strFormat(str,iLen)
{
if(str.length<iLen)
{
for(iIndex=0;iIndex<iLen-str.length;iIndex++)
{
str="0"+str;
}
return str;
}
else
{return str;}
}
setInterval("setImg()",2000);
</script>
<center>
<div id="ClockID">
</div>
</center>
angel7532
2004-09-22
打赏
举报
回复
页面上
<head> <meta http-equiv="refresh" content="3;url=err.htm"></head>
或
<%
response.addHeader("Refresh","6");
%>
都能刷新该页,就能动态显示时间了
chen980347
2004-09-22
打赏
举报
回复
我想用java中的DATA()这个方法不就可以
rosifox
2004-09-22
打赏
举报
回复
只能使用JavaScript或者别的工具,
JSP不行,因为JSP是在服务器端执行的
jsp页面
上
显示
天气预报和
动态
时间
本文介绍如何在
jsp页面
中实现天气预报信息的
显示
以及
动态
更新当前
时间
的功能,包括两个主要部分:一是集成天气API获取并展示天气信息,二是利用JavaScript实现实时
时间
的
动态
刷新。
JSP实现
动态
时间
显示
教程
本文介绍了JSP技术及其应用场景,阐述了
动态
时间
显示
原理。详细讲解了通过JSP内置对象获取服务器
时间
,结合JavaScript和AJAX实现
时间
持续更新。还提及了在实现过程中,要考虑性能优化、错误处理和用户体验等因素,帮助开发者在
JSP页面
实现
动态
时间
显示
。
jsp页面
实现
显示
当前的日期
时间
本文介绍两种在
JSP页面
上
显示
当前日期
时间
的方法:一是使用Java代码进行格式化输出,二是利用JavaScript实现
动态
更新的
时间
显示
。这两种方法均可根据需求调整
时间
格式。
jsp页面
中两种方式
显示
当前
时间
本文介绍两种在
JSP页面
上
显示
当前日期
时间
的方法:一是使用Java代码进行格式化输出;二是采用JavaScript实现
动态
更新
时间
。
jsp页面
显示
动态
时间
本文介绍了两种在网页上实现实时更新的
动态
时钟的方法。第一种使用JSP和JavaScript,通过设置定时器每秒更新
时间
显示
。第二种采用纯HTML结合JavaScript的方式,同样实现了
时间
的实时更新
显示
。
Web 开发
81,111
社区成员
341,725
社区内容
发帖
与我相关
我的任务
Web 开发
Java Web 开发
复制链接
扫一扫
分享
社区描述
Java Web 开发
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章