PDA

View Full Version : Passing information between frames


ITL
07-31-2005, 09:21 AM
I need to make a webpage with two frames - the bottom frame will contain images in tables, and when an image is clicked, I need it's URL to appear in a text box in the top frame so that it can be highlighted and copied by the user.

I want to use frames so that the text box for the URL is always in view, even if the bottom frame has been scrolled down.

Is there a way to do this?

(BTW - I know that right clicking on an image will give the URL, I just want to make a neat way of getting the URL of an image - the webpage will be used as an avatar gallery).

Thank you.

Jon Hanlon
07-31-2005, 06:42 PM
Frames are considered window objects.
If you have two frames -- called (say) ftop and fbot -- then
self.parent.frames.fbot // accesses fbot from ftop
self.parent.frames.ftop // accesses ftop from fbot.

You always need to go through the parent frameset.

ITL
07-31-2005, 10:33 PM
Cool, thanks.

Here is a very basic version of the webpage I'm making - it doesn't have frames, but does have a working "clickable image" code:

http://troll1.atspace.com/avatargallery1.htm

So how would I turn this into the two - framed webpage I described above?