一页面延时跳转功能的解决方案
1
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="3;url=login.html">
<title>登录失败</title>
</head>
<body>
<h1>登录失败!稍等3秒,自动跳转到等界面</h1>
</body>
</html>
2
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JavaScript</title>
</head>
<html>
<body>
<p>5s后跳转跳转</p>
<script type="text/javascript">
function jump(){
window.location.href='http://www.baidu.com/';
}
setTimeout(jump,5000);
</script>
</body>
</html>
二使用iframe标签出现页面404的问题的解决方案
因为iframe是使用src引用地址,所以想使用iframe标签必须在控制器中加上相应的控制器跳转
<iframe id="index" src="index" style="width: 100%;border: 0;"></iframe>
@RequestMapping("index")
public String touser() {
return "WEB-INF/index.jsp";
}
自己做项目遇到的问题 ,记录一下。
三子页面跳出iframe标签父页面的解决方案
1、
<script type="text/javascript">
if (top.location !== self.location) {
top.location=self.location;
}
</script>
2、
<script type="text/javascript">
if (top.location !== self.location) {
top.location = "../index.jsp";//跳出框架,并回到首页
}
</script>
3、
if(window.parent.length>0)
window.parent.location=location;
//*******************
if (window != top)
top.location.href = location.href;