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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reloading a frame without onClick?

Status
Not open for further replies.

eclipse33

Programmer
Apr 13, 2001
94
CA
I have a site done in frames. Is there a way to reload one frame (ex: sidebar) while inside the main.asp frame. I am changing a boolean in the main frame and the navigation on the sidebar frame depends on the value of this boolean...therefore it needs to be reloaded.

I can do it with the click on a link but I want to do it within the code.



<FRAMESET COLS=&quot;135,*&quot; FRAMEBORDER=&quot;NO&quot; BORDER=&quot;0&quot; FRAMESPACING=&quot;0&quot;>
<FRAME NAME=&quot;sidebar&quot; SCROLLING=&quot;NO&quot; leftmargin=&quot;0&quot; topmargin=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; frameborder=&quot;no&quot; SRC=&quot;sidebar.asp&quot;>
<FRAME NAME=&quot;main&quot; SCROLLING=&quot;YES&quot; leftmargin=&quot;5&quot; topmargin=&quot;5&quot; marginwidth=&quot;5&quot; marginheight=&quot;5&quot; frameborder=&quot;no&quot; SRC=&quot;main.asp&quot;>
</FRAMESET>
 
If your left frame has a target name of 'menu' then either:
Code:
top.frames[0].location.reload();
OR:
Code:
top.frames[ 'menu' ].location.reload();
Should work. Cheers, Neil :)
 
Thanks Neil...one more thing

The code below gave me an error (object doesn't exist or is null)...(sidebar is the right name for the frame)

top.frames['sidebar'].location.reload();


but if I changed the 0 with a 2 it worked ok

top.frames[2].location.reload();

This is the first page I have done in frames so excuse my lack of frame knowledge...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top