/    Sign up×
Community /Pin to ProfileBookmark

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 )?

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@KorMar 04.2004 — parent.thatfunction();
Copy linkTweet thisAlerts:
@EfraimauthorMar 07.2004 — I'll try that thx
Copy linkTweet thisAlerts:
@EfraimauthorMar 07.2004 — What if I want to change the document.location of another frame from the parent??

(like parent.frames['bottom'].document.location)?
Copy linkTweet thisAlerts:
@KorMar 08.2004 — 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...
×

Success!

Help @Efraim spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...