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" id = "frames1"/>
<Frame src = "B. jsp" name = "mainframe" scrolling = "no" noresize = "noresize" id = "frames2"/>
<Frame src = "C. jsp" name = "bottomframe" scrolling = "no" noresize = "noresize" id = "frames3"/>
<Noframes>
<Body>
<P> This page uses frames. The current browser you are using does not support frames. </P>
</Body>
</Noframes>
</Frameset>
</Html>
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 = "#" id = "B"> B. jsp </a> <br>
<A onclick = "loginb ()" href = "#" id = "C"> C. jsp </a> <br>
<A onclick = "logina ()" href = "#" id = "C"> A and B </a> <br/>
<Center>
Use js to control the framework
</Center>
</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 id = "A" onclick = "test ()" href = "#"> A. jsp </a>
</Body>
</Html>
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" type = "codeph" text = "/codeph">
This is C. jsp
</Body>
</Html>
System. js
Function logina (){
Alert ("Changing B and C frameworks at the same time ");
Parent. Mainframe. Location. href ("C. jsp ");
Parent. bottomframe. Location. href ("B. jsp ");
}
Function loginc (){
Alert ("Change B. jsp of framework B to C. jsp ");
Parent. Mainframe. Location. href ("C. jsp ");
}
Function loginb (){
Alert ("Change C. jsp of the c framework to B. jsp ");
Window. Parent. Frames ["bottomframe"]. Location. href ("B. jsp ");
}
The main reason is that you have never learned Javascript. Many JS built-in objects or functions are your own.
The jump to the framework can be:
1: window. Parent. Frames ["framework to be modified"]. Location. href ("Jump path ");
2: window. Parent. frames. Item (location where the framework is stored in the framework set). Location. href ("Jump path ");
3: window. Parent. frames. Item ("framework to be modified"). Location. href ("Jump path ");
4: window. Parent. Framework name. Location. href ("Jump path ");
5: window. Parent ["framework name"]. Location. href ("Jump path ");
6: window. Parent. frames. Framework name. Location. href ("Jump path ");