1.frameSet布局页面
<frameset rows="200,*">
<frame src="top.jsp" name="topFrame"/>
<frameset cols="20%,*">
<frame src="left.jsp" name="leftFrame"/>
<frame src="right.jsp" name="rightFrame"/>
</frameset>
</framset>
2.跳出frameset框架转到新的页面
window.parent.location.href('http://localhost:8080/SpringMVC/login.jsp')
替换frameset框架中左右两边的部分(其中rightFrame和leftFrame为frame的名字)
parent.leftFrame.location.href("c.jsp");
parent.rightFrame.location.href("b.jsp");
点击链接替换frameset框架中的frame部分
<script>
function changeLR(){
parent.leftFrame.location.href("left.jsp");
parent.rightFrame.location.href("index.jsp");
}
function change(){
parent.leftFrame.location.href("http://localhost:8080/TestSession/left.jsp");
parent.rightFrame.location.href("http://localhost:8080/TestSession/count");
}
window.οnlοad=function(){
var flag=document.getElementById("flag").value;
//alert(flag=="true");
if(flag=="true"){
change();
}
}
</script>
使用空链接跳转
<a href="#" οnclick="changeLR();">SpringMVC</a>
带连接(action)的跳转:
<a href="http://localhost:8080/TestSession/login?username=<%=request.getParameter("username") %>&psw=<%=request.getParameter("password") %>" >TestSession</a>
<input name="flag" type="hidden" value="<%=request.getParameter("flag") %>" id="flag"/>