Click to See Complete Forum and Search --> : Iframes


Efraim
03-04-2004, 05:36 AM
Hey, all!

A new braincracker is troubling my mind:
In a 'normal' frameset, one can use javascript to call functions from the other frames page like this:
parent.frames.<<framename>>.MyFunction();

It works fine.

Now the trouble:
In an Iframe I want to call a function from the parent document.
parent.frames is an object, but the parent.frames.<<framename>> doesn't exist!!
This because the document in the Iframe can have frames as well and turns out to be the parent. (I think)

So my question is:
How can I use javascript, in an Iframe, to call functions from the document in wich the Iframe is (the real parent parent... g )?

Kor
03-04-2004, 05:58 AM
parent.thatfunction();

Efraim
03-07-2004, 02:56 AM
I'll try that thx

Efraim
03-07-2004, 02:59 AM
What if I want to change the document.location of another frame from the parent??

(like parent.frames['bottom'].document.location)?

Kor
03-08-2004, 01:44 AM
that is the reverse reference.

If in parent, the page in iframe is to be found

top.frames[name_or_order].myfunction9)
top.frames[name_or_order].document......

If in any other frame, the parent is to be found in unique

patent.myfunction()
parent.dpcument...