SoFunction
Updated on 2025-03-03

Seven ways to refresh frame subpage code

The page is named as an example to explain how to do it.
It consists of two pages, the code is as follows:
Copy the codeThe code is as 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="">
<frame name=button src="">
</frameset>
</HTML>

Now suppose that the above page has a button to refresh the following page, you can use the following seven statements, which one is easier to use.
Statement 1. [1].();
Statement 2. ();
Statement 3. ["bottom"].();
Statement 4. (1).();
Statement 5. ('bottom').();
Statement 6. ();
Statement 7. ['bottom'].();
Let's explain:
Refers to the current page, for example, it refers to the page.
Refers to the parent page of the current page, that is, the frame page containing it. For example, for this example it refers to.
It is a window object, an array. Represents all subpages in this framework.
It's the method. Returns the elements in the array.
5. If the subpage is also a frame page and there are other subpages inside, then some of the above methods may not work.
Source code; (There are seven buttons on the page, and the functions are all refreshing the frame page below)
Copy the codeThe code is as follows:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
</HEAD>
<BODY>
<input type=button value="refresh 1" onclick="[1].()"><br>
<input type=button value="refresh 2" onclick="()"><br>
<input type=button value="refresh 3" onclick="['bottom'].()"><br>
<input type=button value="refresh 4" onclick="(1).()"><br>
<input type=button value="refresh 5" onclick="('bottom').()"><br>
<input type=button value="refresh 6" onclick="()"><br>
<input type=button value="refresh 7" onclick="['bottom'].()"><br>
</BODY>
</HTML>

Below is the page source code. In order to prove that the page below has indeed been refreshed, a dialog box pops up after the loading page.
Copy the codeThe code is as follows:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
</HEAD>
<BODY onload="alert('I'm loaded!')">
<h1>This is the content in .</h1>
</BODY>
</HTML>