The three pages are separated into main.htm, left.htm, and right.htm in the same window.
Main.htm
Copy codeThe Code is as follows: <Head>
<Title> implementation across </title>
</Head>
<Body>
<Div> Main Window </div>
<Iframe id = "left" name = "left" width = "500px" height = "300px;" src = "left.htm"> </iframe>
<Iframe id = "right" name = "right" width = "100px" height = "100px;" src = "right.htm"> </iframe>
</Body>
</Html>
Left.htmCopy codeThe Code is as follows: <Head> <title> left </title> <Body>
<Div> I am on the left </div>
<Div> </div>
</Body>
</Html>
Right.htmCopy codeThe Code is as follows: <Head> <title> right </title> <Body>
<Div>
<Input onclick = "onclickRefresh ();" type = "button" value = "Submit"/> </div>
<Script type = "text/javascript">
Function onclickRefresh ()
{
Parent. frames ["left"]. location. reload ();
// Window. left. location. reload ();
}
</Script>
</Body>
</Html>
See right.htm.
Function onclickRefresh () refreshes the left page on the right through parent. frames ["left"]. location. refresh.
If you addCopy codeThe Code is as follows: <div> <input type = "button" onclick = "mainRefresh ();" value = ""/> </div>
<Script type = "text/javascript">
Function mainRefresh ()
{
Window. left. location. reload ();
}
</Script>
You can refresh the subpage on the home page.
Although this can be implemented in a simple way, data in actual projects is not so simple. The most common is the left/right tree, creating and loading a directory tree (for example, creating one thousand nodes) is inherently resource-consuming. If you still need to refresh the Left and Right pages in a way that is less efficient and visible, can you use other methods to achieve cross-origin refresh or commit?
All I think is to use ajax to locally load data. Instead of loading the entire tree. In addition, you can use jquery's json processing method to update local data.
I wonder if there are other more efficient methods? The efficiency of loading trees on 1000 nodes is worth thinking about.