[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Writing into frames ...

Nils Decker wrote:
> I have a problem : My university restricts my homepage to exactly one
> file :-(. I want to make a homepage with multiple frames. I got the idea,
> that I create the frames with JavaScript and then let a script fill the
> content into the frames.
> I have the following problems :
> I wasn't able to call a function in the onLoad statement of the <FRAME
> tag ( the tag doesn't contain a SRC part. The function is never called.
> If I places the init function into a function that is loaded in the
> onLoad of FRAMESET, then I wasn't able to write anything into the frames.
> I might have used the wrong object ( he always says, that the object has
> no Methods. )

First of all... change universities! ;)

Ok, now for the real help... the onLoad event handler is not used in the FRAME tag, but
is used in the FRAMESET tag. So you could put an onLoad handler in the FRAMESET tag
which then writes to your frames (using the parent.frames[] array). Since the onLoad
event is generated after all the child frames have been created you can access the
frames from the event handler. Due to a bug (at least i HOPE it's a bug, not a
"feature") in order to access the frames this way, you need to have a SRC attribute in
the frame definition. Netscape allows you to say <FRAME SRC = "about:blank"> which will
allow the frame to be accessed via the frames[] array.

-- Robert


Robert Thuleen
Sr. Software Engineer
Science Applications International Corp (SAIC)
San Diego, Ca

For help about the list, please send a message to 'majordomo@obscure.org'
with the message body 'help'. To unsubscribe, send a message to
'majordomo@obscure.org' with the message body 'unsubscribe javascript'.
List archives and pointer to FAQ: http://www.obscure.org/javascript/