JavaScript: window.location inside a frame?

Hi,

I have a page with a small frame on the top, and another on the bottom. I was wondering what code I would use to specify the URL of the bottom frame FROM the top?

IE: I have a JavaScript variable called “location”, which holds the URL I would like to load in the frame. The frame is called “main”.

I tried this like

location = window.frames.main.location

and

location = window.main.location

but nothing seems to work. Can someone help me out? :slight_smile:

Hi TWT,

this should do the job…

parent.main.location=‘your_page.htm’

(When you’ve got a framed page, window refer to the current frame. If you want to refer to the main window you’ve got to use parent.As well if you want to interact with other frames you have to pass by the main window. It’s like a path to access frames within you pages).

<Edited by cyberbrain on 12-01-2000 at 05:10 PM>

Thanks cyberbrain - it was totally driving me nuts!

Can you possibly, in addition, point me to a tutorial on JavaScript’s DOM?

Unfortunately I don’t know any site specifically consacred to the DOM. (your best guess would be to visit the NS or IE website or some javascript tutorial site).
Anyone?