`
hoho922
  • 浏览: 32359 次
  • 性别: Icon_minigender_1
  • 来自: 上海
文章分类
社区版块
存档分类
最新评论

js页面自动跳转实现

阅读更多
   下面一段代码是告诉浏览器,过多久就刷新转到新的页面,采用的是页面定时刷新元标识(Meta Refresh Tag)。只能放在HTML代码的<HEAD>区里。
<meta http-equiv="refresh" content="5" url=http://www.google.com"> 


现在做的一个项目用到的跳转:
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../include/const.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><c:out value="${PAGE_TITLE}" /></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="<%=desp%>">
<meta name="company" content="<%=company%>">
<meta http-equiv="refresh" content="3;url=/index.do">
<!-- Le styles -->
<style type="text/css">
    body {
      padding-top: 60px;
      padding-bottom: 40px;
    }
    .sidebar-nav {
      padding: 0;
    }
</style>
  
  
<link href="/css/bootstrap.css" rel="stylesheet">
</head>
<body>

<%@ include file="../include/header.jsp"%>

<table width="75%" border="0" align="center" cellpadding="3"
	cellspacing="1">
	<tr>
	   <td width=30% height=255 align=center><img src="/img/errormsg.jpg" width=155px height=155px border=0 /></td>
		<td  width=60% height="255" valign="middle" align="center"
			style="line-height:25px;">
		<div style="color:#777;font-size:14px;line-height:35px;">	
			<span style="font-weight:bold;color:#ff0000;">出错了!</span><a style="color:#777;" href="<c:out value="${PAGE_GO_URL}"/>">
			<span style="color:#ff0000;"><c:out value="${PAGE_MSG}" /></span>
		<br>
		系统将在3秒钟后自动返回<br>
		如果系统没有自动返回,请单击此处自行返回</a> <br>
		<a style="color:#666;text-decoration:underline;font-weight:normal;" href="<c:out value="${PAGE_FROM_URL}"/>"><--如果你想继续<c:out
			value="${PAGE_TITLE}" />请单击此处</a>
		</div>	</td>
	</tr>
</table>

<%@ include file="../include/footer.jsp"%>
	 
</body>
</html>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics