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

Calling functions from other frames

Status
Not open for further replies.

Iroaku

Programmer
May 11, 2006
1
NL
Hey folks. I have a bit of an issue here that i cant seem to figure out. In essence i have a .js file loaded into my frame container. There are variables in this .js file that need to stay the same and not be reset with the reloading of the page, so that is why i didnt load it into the frames themselves. In my left frame i have a menu. I want to via a link in the left frame call a function that is loaded into the container and then have the result of the function output into the right frame. How would i go about doing this? If this isnt possible are there any other solutions to keep variables loaded and saved while frames are reloaded? Thx for the help.
 
This is no problem. Simply prefix all references with "top" or "parent" (depending on the number of levels of nesting you have) from any frame to access items in the frameset page itself. So, from your left frame, you might use:

Code:
parent.yourFuncName(args);

And from the top frame, you should be able to use:

Code:
document.frames['rightFrameName'].

or possibly even

Code:
document.rightFrameName.

to access the right-hand frame.

Hope this helps,
Dan

Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top