But the latter have an advantage in maintaining the location of the page scroll bar location.href = location.href
This pop-up pages in an effective brush, which will expire the first two
-------------------------------------------------- -------------------------------------------
First look at a simple example:
The following three pages named frame.html, top.html, bottom.html as an example to specify what should be done.
frame.html from (top.html) under (bottom.html) composed of two pages, the code is as follows:
<! DOCTYPE HTML PUBLIC "- / / W3C / / DTD HTML 4.0 Transitional / / EN">
<HTML>
<HEAD>
<TITLE> Frame </ TITLE>
</ HEAD>
<frameset rows="50%,50%">
<frame name=top src="top.html">
<frame name=bottom src="bottom.html">
</ frameset>
</ HTML>
Now assume top.html (that is, the page above) to achieve seven button on bottom.html (that is, the following page) is set, you can use the following seven statements, which use their own the看着办.
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 ();
Framework includes a number of sub-frames are as follows: window.parent.frames.f1.f2 ... location.reload (); (layers of writing, f1, f2 for the names of sub-frames)
top.html page code is as follows:
<! DOCTYPE HTML PUBLIC "- / / W3C / / DTD HTML 4.0 Transitional / / EN">
<HTML>
<HEAD>
<TITLE> Top.html </ TITLE>
</ HEAD>
<BODY>
<input type=button value="刷新1""window.parent.frames[1].location.reload()"> <br>
<input type=button value="刷新2"> <br>
<input type=button value="刷新3""window.parent.frames['bottom'].location.reload()"> <br>
<input type=button value="刷新4"> <br>
<input type=button value="刷新5"> <br>
<input type=button value="刷新6"> <br>
<input type=button value="刷新7""window.parent['bottom'].location.reload()"> <br>
</ BODY>
</ HTML>
The following is a bottom.html page source code, in order to prove that was indeed the bottom of the page to refresh, and finished loading the page in a pop-up dialog box.
bottom.html page code is as follows:
<! DOCTYPE HTML PUBLIC "- / / W3C / / DTD HTML 4.0 Transitional / / EN">
<HTML>
<HEAD>
<TITLE> Bottom.html </ TITLE>
</ HEAD>
<BODY Onload="alert('我被加载了!')">
<h1> This is the content in bottom.html. </ h1>
</ BODY>
</ HTML>
Explain:
1.window refer to the current page, for example, in this case it refers to the top.html page.
2.parent refers to the parent page the current page, which is included in the framework of its pages. For example, in this case it refers to the framedemo.html.
3.frames is the window object is an array. Represents the framework of all the sub-page.
4.item methods. Return to the elements inside the array.
5. If the framework is also a sub-page page, which is a subset of the other pages, then some of the above methods may not.
Attachment:
Javascript refresh the page several ways:
1 history.go (0)
2 location.reload ()
3 location = location
4 location.assign (location)
5 document.execCommand ( 'Refresh')
6 window.navigate (location)
7 location.replace (location)
8 document.URL = location.href
Automatically refresh the page method:
1. Page automatically refreshes: the following code to <head> area <meta http-equiv="refresh" content="20">
20 means every 20 seconds to refresh a page.
2. Page automatically Jump: the following code to <head> area <meta http-equiv="refresh" content="20;url=http://www.wyxg.com">
20 means 20 seconds after every http://www.wyxg.com Jump to page
3. Js version of the page automatically refresh <script language="JavaScript">
function myrefresh ()
(
window.location.reload ();
)







