inicio mail me! sindicaci;ón

With 7 kinds of methods of page of frame of Javascript refresh casing

Name respectively with 3 pages below for Framedemo.html, top.html, button.html is exemple come how is specific specification done.

Among them Framedemo.html by fluctuation two pages are comprised, code is as follows:

It is quotative content below:

< ! 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>

Assume now Top.html namely the break that the page above has a Button to realize next pair of recto extents, can below in order to 7 kinds of statements, which good look at with oneself did.

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();

Explain:

1.window shows acting is current page, be opposite for example hereat exemple what it points to is Top.html page.

What 2.parent points to is the father page of current page, include its frame page namely. Be opposite for example hereat exemple what it points to is Framedemo.html.

3.frames is Window object, it is an array. Representing this frame inside all child page.

4.item is a method. Return the element inside array.

5. is like fruit page also is a frame page, other still is inside child page, so some methods above may be no good.

Top.html source code; (There are 7 buttons on the page, the function is the frame page below refresh)

It is quotative content below:

< ! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
</HEAD>
<BODY>
1" Onclick= "window.parent.frames[1].location.reload()" ><br> of refresh of <input Type=button Value= "
2" Onclick= "window.parent.frames.bottom.location.reload()" ><br> of refresh of <input Type=button Value= "
3" Onclick= "window.parent.frames[’bottom’].location.reload()" ><br> of refresh of <input Type=button Value= "
4" Onclick= "window.parent.frames.item(1).location.reload()" ><br of refresh of <input Type=button Value= ">
5" Onclick= "window.parent.frames.item(’bottom’).location.reload()" ><br> of refresh of <input Type=button Value= "
6" Onclick= "window.parent.bottom.location.reload()" ><br> of refresh of <input Type=button Value= "
7" Onclick= "window.parent[’bottom’].location.reload()" ><br> of refresh of <input Type=button Value= "
</BODY>
</HTML>

Bottom.html page source code is below, to prove lower part page really by refresh, in lade the page is played give a dialog box.

It is quotative content below:

< ! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
</HEAD>
<BODY Onload= "alert(’ I by to load! ‘)" >
<h1>This Is The Content In Button.html. </h1>
</BODY>
</HTML>

Bookmark:Digg Del.icio.us Reddit

Leave a Comment