Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Frame refresh via javascript from another frame?

Status
Not open for further replies.

Ovatvvon

Programmer
Feb 1, 2001
1,514
US
Hello,
I have a tripple framed site (top frame, left frame, and content frame). At one point I have an option for a member to reselect the color scheme they want for their experience on the site, however, to reset the colors in all the frame, I need to refresh them all. I can't use parent.window.location.href = "myWebSite.com"; because there is the origianl page with the top and bottom frame, and within the bottom frame there is the left and right frames. If I used that, it would only relocate the bottom two frames.

Is there a way to direct the top and left frames to refresh such as browser.top.refresh(); or something to that effect?

Thanks for any help in advance! -Ovatvvon :-Q
 
ya there is. the frames are stored in a 'frames' array. for example, u can access the 2nd frame by parent.frames[1]. then u can give parent.frames[1].location.href = "file.html" or refresh() ( i think that function exists).

luv
Karthik.
Pearls and Diamonds are not found on surfaces.
 

try this:

Code:
parent.top.document.location.reload();
parent.left.document.location.reload();

this might work provided all three frames are contained in by one single frameset. like so:
Code:
<frameset cols=3>
<frame name=top src=1.htm>
<frame name=left src=2.htm>
<frame name=content src=3.htm>
</frameset>

give me a ring if there are any problems.

biggie
 
With adding a bit to get the parent frames parent, I got it to work like so...

<SCRIPT LANGUAGE='javascript'>
<!--
parent.parent.frames[0].location.reload();
parent.frames[0].location.reload();
window.location.href = 'moGeneral.asp'
// -->
</SCRIPT>

Thanks for leading me in the direction. -Ovatvvon :-Q
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top