Accessing <frame> from within frameset

HTML, CSS and anything else that deals with client side capabilities.

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Accessing <frame> from within frameset

Post by alex.barylski »

I have some JS which reside in a file that is the the first frame of a frameset:

[js]var website = window.parent.document.getElementById('website').window;[/js]

Everything up to the .window returns a valid object (HTMLFrameElement).

I need to change some elements in the in the second frameset from within the first, at the very least I need to be able to change the URL of the second frameset from within the first.

Both framesets are hosted on the saome domain so I believe I have the ability to manipulate the DOM which might be helpful but for now just changing the URL of the second will be enough, if I can figure out how to go further than above???
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Accessing <frame> from within frameset

Post by alex.barylski »

Turns out contentWindow was the other object I needed...unless there is a better way?

p.s-Using jQuery hopefully.
Post Reply