Jsp和js倒计时跳转页面
来源:互联网 发布:淘宝商城希恩卫浴 编辑:程序博客网 时间:2024/04/26 03:45
Jsp和js倒计时跳转页面
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%><%String path = request.getContextPath();//得到项目的名字String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;//服务器端的路径%><% String url = basePath+"/user/registerView";%><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>${webSite.webSiteName}邮箱激活</title><link rel="stylesheet" type="text/css" href="<%=basePath%>/css/common.css" /><link rel="stylesheet" type="text/css" href="<%=basePath%>/css/index.css" /><link rel="stylesheet" type="text/css" href="<%=basePath%>/css/other.css" /><script src="<%=basePath%>/js/jquery/jquery-1.7.2.min.js"type="text/javascript"></script>
<script type="text/javascript">var t = 3; //设置一个跳转秒数$(function(){ setInterval("count()",1000); //定义一个定时器 $("#timeCount").html(t); //显示当前的秒数});function count(){ t--; //秒数自减 if(t >= 0){ /* alert(location.href); alert(window.location.host+window.location.pathname); */ $("#timeCount").html(t); //刷新当前的秒数,重新显示秒数 }else{ window.location.href=getRootPath()+"/user/registerView"; // 设置跳转的链接 }}//js获取项目根路径,如: http://localhost:8080/ivcfunction getRootPath(){//获取当前网址,如: http://localhost:8080/ivc/share/meun.jspvar curWwwPath=window.document.location.href;//获取主机地址之后的目录,如: ivc/share/meun.jspvar pathName=window.document.location.pathname;var pos=curWwwPath.indexOf(pathName);//获取主机地址,如: http://localhost:8080var localhostPaht=curWwwPath.substring(0,pos);//获取带"/"的项目名,如:/ivcvar projectName=pathName.substring(0,pathName.substr(1).indexOf('/')+1);return(localhostPaht+projectName);}</script>
</head><body> <jsp:include page="header.jsp"></jsp:include> <!--中心content Start--> <div class="content widthCom warp marginCenter"> <div class="activateCont"> <img src="<%=basePath%>/images/error_icon.png" /><h3>链接失效,请重新注册</h3><br /> <span id="timeCount" style="color:red"></span>秒钟后页面将自动返回注册页面...</b> </div> </div> <!--中心content End--> <jsp:include page="footer.jsp"></jsp:include></body></html>
0 0
- Jsp和js倒计时跳转页面
- jsp倒计时 页面跳转
- js倒计时跳转 页面
- jsp网页倒计时跳转页面
- jsp倒计时页面自动跳转
- jsp页面倒计时自动跳转
- js实现倒计时跳转页面
- js页面倒计时自动跳转
- js编写倒计时跳转页面
- js实现页面跳转倒计时
- js和jsp所有页面跳转总结
- jsp页面实现倒计时自动跳转
- html JavaScript js倒计时跳转页面
- js是实现页面倒计时跳转
- 【转】js倒计时并实现页面跳转
- 页面倒计时自动跳转的js脚本
- jsp实现页面倒计时跳转到指定页面
- jsp 和 js 跳转
- Ganymed SSH-2 for Java系列6之删除远程服务器上的非空目录
- 社会工程学的特点和趋势
- VO、DTO、DO、PO的概念、差别和用处
- POJ 1458 Common Subsequence
- Linux目录结构
- Jsp和js倒计时跳转页面
- 在同一网关下ping不通其他电脑
- Android 自定义 地图 室内
- Lunix下MySql的安装及启动
- 有关字符串函数
- Java Collection 集合类和Java Map接口
- 一个新的开始,一个旧的结束,致我最爱的青春
- 数据挖掘方法(3)回归假设检验
- VB使用devcon.exe 自动安装inf驱动