jsp网页倒计时跳转页面

来源:互联网 发布:windows命令行创建文件 编辑:程序博客网 时间:2024/05/01 00:01
<span style="font-size:18px;"><%@ page language="java" contentType="text/html; charset=utf-8"    pageEncoding="utf-8"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><HTML><HEAD><meta http-equiv='refresh' content='3;url=indexAction'><!--content='页面停留时间(这里单位是秒);url=跳转至另一页面'  --><script type='text/javascript'>var i=3;function getTime(){document.getElementById('num').innerHTML="<font color='red'>"+i+"</font>";i-=1;var x=setTimeout('getTime()',1000)//1000毫秒=1秒if(i<=0){clearTimeout(x);}}window.onload=getTime;//开始执行倒计时</script><TITLE>${message}</TITLE></HEAD><BODY><br><center><h2>${message}<br>注意!!页面将在<span id='num' style='display=inline;'>3</span>秒后跳转至主页</h2></center></BODY></HTML> </span>

0 0
原创粉丝点击