The following describes how to do this by naming the three pages as framedemo.html, top.html, and button.html.
In this example, framedemo.html consists of two pages,CodeAs follows:
<! Doctype HTML public "-// W3C // dtd html 4.0 transitional // en">
<HTML>
<Head>
<Title> framedemo </title>
</Head>
<Frameset rows = "50%, 50%">
<Frame name = Top src = "top.html">
<Frame name = button src = "button.html">
</Frameset>
</Html>
Now, let's set the top.html, that is, there is a button on the above page to refresh the following page. You can use the following seven statements.
Statement 1. Window. Parent. Frames [1]. Location. Reload ();
Statement 2. Window. Parent. frames. Bottom. Location. Reload ();
Statement 3. Window. Parent. Frames ["bottom"]. Location. Reload ();
Statement 4. Window. Parent. frames. Item (1). Location. Reload ();
Statement 5. Window. Parent. frames. Item ('bottom '). Location. Reload ();
Statement 6. Window. Parent. Bottom. Location. Reload ();
Statement 7. Window. Parent ['bottom ']. Location. Reload ();
Explanations:
1. windowless refers to the front page. For example, this refers to the top.html page.
2. Parent refers to the parent page of the current page, that is, the framework page containing it. In this example, framedemo.html is used.
3. frames is a window object and an array. Represents all the child pages in the framework.
4. item is a method. Returns the elements in the array.
5. If the sub-page is also a framework page and contains other sub-pages, some of the above methods may not work.
Top.htmlSource code; (There are seven buttons on the page, and the function is to refresh the following framework page)
<! Doctype HTML public "-// W3C // dtd html 4.0 transitional // en">
<HTML>
<Head>
</Head>
<Body>
<Input type = button value = "Refresh 1" onclick = "window. Parent. Frames [1]. Location. Reload ()"> <br>
<Input type = button value = "Refresh 2" onclick = "window. Parent. frames. Bottom. Location. Reload ()"> <br>
<Input type = button value = "Refresh 3" onclick = "window. Parent. Frames ['bottom ']. Location. Reload ()"> <br>
<Input type = button value = "Refresh 4" onclick = "window. Parent. frames. Item (1). Location. Reload ()"> <br>
<Input type = button value = "Refresh 5" onclick = "window. Parent. frames. Item ('bottom '). Location. Reload ()"> <br>
<Input type = button value = "Refresh 6" onclick = "window. Parent. Bottom. Location. Reload ()"> <br>
<Input type = button value = "Refresh 7" onclick = "window. Parent ['bottom ']. Location. Reload ()"> <br>
</Body>
</Html>
The following is the source code of the bottom.html page. to verify that the page below is refreshed, a dialog box is displayed after the page is loaded.
this is the content in button.html.