main.html 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
<title>mainFrames</title> 
</head> 
<frameset rows="30%,40%,30%" cols="" border="1" frameborder="yes" > 
     <frame src="a.jsp" name="topFrame" scrolling="No" noresize="noresize" > 

 

a.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"> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
<script type="text/javascript" src="./js/system.js"></script> 
<title>a.jsp</title> 
</head> 
<body bgcolor="#F3f3f3"> 
<a onclick="loginC()" href="#" > 

</body> 
</html> 

b.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"> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
<script type="text/javascript" src="./js/system.js"></script> 
<title>b.jsp</title> 
</head> 
<body bgcolor="#fed342"> 
    this is b.jsp! 
<a > 

c.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"> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
<title>c.jsp</title> 
</head> 
<body bgcolor="#565321"> 
this is c.jsp 
</body> 
</html> 

system.js 

function loginA(){ 
alert("把B和C框架同时改变");
parent.mainFrame.location.href("c.jsp"); 
parent.bottomFrame.location.href("b.jsp"); 
} 
function loginC(){ 
alert("把B框架的b.jsp换成c.jsp"); 
parent.mainFrame.location.href("c.jsp"); 
} 
function loginB() { 
alert("把C框架的c.jsp换成b.jsp"); 
window.parent.frames["bottomFrame"].location.href("b.jsp"); 

} 
主要在于自己的js没有学过,很多js的内置对象或者为函数自己都。 
对于框架的跳转可以为: 
1:window.parent.frames["需要修改的框架"].location.href("跳转的路径"); 
2:window.parent.frames.item(框架在框架集数组中存放的位置).location.href("跳转的路径"); 
3:window.parent.frames.item("需要修改的框架 此为框架名称").location.href("跳转路径"); 
4:window.parent.框架名称.location.href("跳转路径"); 
5:window.parent["框架名称"].location.href("跳转路径"); 
6:window.parent.frames.框架名称.location.href("跳转路径");

相关文章:

  • 2022-12-23
  • 2022-01-13
  • 2021-06-20
  • 2022-12-23
  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-03
  • 2021-12-03
  • 2022-02-28
  • 2022-12-23
相关资源
相似解决方案