如何使iframe里面嵌套的html代码能实现整个页面的跳转,而并非是在iframe中跳转页面。

liulingrui 2019-01-18 02:18:32
如下图所示,在下新手,在做一个简单的信息管理系统,是个毕业设计,我将页面的主要区域划分为三个部分,区域一是用表格做的,区域二和区域三是iframe。


现在想要实现的效果是在区域一点击了“系统维护之后”,区域二发生变化,会显示一个“退出系统”,点击“退出系统后”,区域三会显示一个“注销用户并退出系统”,然后点击“注销用户并退出系统”之后,整个页面跳转到登陆界面index.jsp。

但是现在的问题是第三步点击了之后,是下面的这种效果,在区域三内部发生了变化,即代码只在iframe内生效了。


相关代码如下:
管理系统主界面Main.jsp代码:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
String user=request.getParameter("LoginUser");
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>欢迎来到企业进销存管理系统</title>
<style type="text/css">
<!--
body{
margin-left:0px;
margin-top:0px;
margin-right:0px;
margin-bottom:0px;
overflow:scroll;
}
.title{
font-size:24px;
font-weight:bold;
}
p.rightmargin{
margin-right:100px;
}
-->
</style>
</head>
<body>
<table>
<tr>
<td height="60" colspan="3" bgcolor="66CCFF">
<center>
<font class="title">
欢迎<%=user%>来到企业进销存管理系统
</font>
</center>
</td>
</tr>
<tr>
<td width="150" height="500">
<table border="1">
<tr>
<td height="50" width="150" bgcolor="FF3300" align="center">
<a href="about/about1.html" target="secondBar">关于</a>
</td>
</tr>
<tr>
<td height="50" bgcolor="00FF00" align="center">
<a href="basicInformationManage/basicInformationManage1.html"
target="secondBar">基本信息管理</a>
</td>
</tr>
<tr>
<td height="50" bgcolor="FFFF00" align="center">
<a href="" target="displayArea">入库管理</a>
</td>
</tr>
<tr>
<td height="50" bgcolor="FF66CC" align="center">
<a href="" target="displayArea">销售管理</a>
</td>
</tr>
<tr>
<td height="50" bgcolor="66CC66" align="center">
<a href="" target="displayArea">退货管理</a>
</td>
</tr>
<tr>
<td height="50" bgcolor="0000FF" align="center">
<a href="" target="displayArea">库存管理</a>
</td>
</tr>
<tr>
<td height="50" bgcolor="FF00FF" align="center">
<a href="systemMaintain/systemMaintain1.html"
target="secondBar">系统维护</a>
</td>
</tr>
<tr>
<td height="50" bgcolor="00FF00"></td>
</tr>
<tr>
<td height="50" bgcolor="66CC66"></td>
</tr>
</table>
</td>
<td width="150" height="500" bgcolor="66CC66">
<iframe src="" name="secondBar" width="100%" height="100%"
scrolling="yes" id="scondBar" frameborder="0">
</iframe>
</td>
<td width="1000" height="500" bgcolor="FFFF00">
<iframe src="" name="displayArea" width="100%"
height="100%" scrolling="yes" id="displayArea" frameborder="0">
</iframe>
</td>
</tr>
</table>
</body>
</html>


“注销用户并退出系统”所在的shutdown.html页面代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<a href="../index.jsp?username=&password=">注销用户并退出系统</a>
</body>
</html>

...全文
1987 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
liulingrui 2019-01-18
  • 打赏
  • 举报
回复
引用 1 楼 qq593467574 的回复:


<a href="#" onclick="javascript:top.location.href='../index.jsp?username=&password='">注销用户并退出系统</a>


大佬牛逼。问题解决了,谢谢
qq593467574 2019-01-18
  • 打赏
  • 举报
回复


<a href="#" onclick="javascript:top.location.href='../index.jsp?username=&password='">注销用户并退出系统</a>

81,094

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧