
Another Netscape Javascript question
Quote:
> Hi! Here is the code:
> *** Main Frameset ***
> <HTML>
> <HEAD>
> </HEAD>
> <FRAMESET id=frmMain name=frmMain>
> <FRAMESET id=frmMenu name=frmMenu>
> <FRAME id=frmMainMenu name=frmMainMenu src="menu.htm">
> <FRAME id=frmSubMenu name=frmSubMenu
> src="submenu.htm">
> </FRAMESET>
> <FRAME id=frmMainPage name=frmMainPage src="MainPage.htm">
> </FRAMESET>
> </HTML>
> When i click an item on the Menu page it loads another page to the
> frmMainPage frame (this works very well because i use the target
> property in the hyperlink). This page (lets call it NewPage.htm) has
> the following code:
> <HTML>
> <HEAD>
> <script>
> function ShowSubMenu() {
parent.frames("frmMenu").frames("frmSubMenu").location.href="submenu2.htm"
;
Quote:
> }
> </script>
> </HEAD>
> <BODY onload="ShowSubMenu();">
> </BODY>
> </HTML>
I was amazed that that code even worked in IE - and then after testing I
found it didn't work, I hope it was because of a mistake in pasting some
code you were trying out, rather than the real code - it crashes out with
a GPF in my IE5.0.- after giving it rows="100,*" in each frameset so it
would be actually rendered in the first place. - Framesets are irrelevant,
you can have 100 framesets in a file, you'll still only have one level of
frames array.
Quote:
> Unfortunatelly i don't have much time to spend looking
> around for this answer and to learn to develop javascript NN oriented
> (IE is much more intuitive) because, like all developers, i have a
> rope around my neck that gets tighter and tigher every day as the
> delivery date for the site gets closer. That's why i sent this (and
> other) message. I know this doesn't belong in the reply for this
> message but i guess Jim Ley will read this message too :)
When you have a deadline it is much, much quicker to get help from a faq,
or an example site, there's loads of resources out there that give example
s which would show your mistakes. www.squeaky.demon.co.uk/jn/meta-faq.htm
is a place to start if you don't know where else to look.
As to learning your job, do you think it would be right for a doctor to
say, I don't have time to go around learning how to operate on a heart,
someone just tell me... ? no if your a professional you've got to spend
time learning your trade.
Anyway in answer to your question.
it's simply
document.frames['subMenuFrame'].location.href
frames[].frames[] is only needed where you have documents with frames
inside frames, not just framesets within framesets.
Jim.