/    Sign up×
Community /Pin to ProfileBookmark

changing iframes in another frame?

HI,

This may sound a little complex.

I am trying to change two iframes with ONE link located in a different frame:

So:

Link x in FRAME1 should change IFRAMEa and IFRAMEb in FRAME2

Is this possible?

Thx!

to post a comment
HTML

1 Comments(s)

Copy linkTweet thisAlerts:
@gohankid77Jul 01.2004 — What you want to do is done in a scripting language like JavaScript. Here is a way to do it with regular frames (I used frame2 and frame3 since you have two iframes in one frame):

The link -

... href="#" onClick="javascript: loadLink('pageReferredForMain.htm', 'pageReferredForMenu.htm')"

The JavaScript function (this goes in the <head> section)-

<script language='JavaScript'>

function loadLink(mainPage, menuPage)

{

parent.frames["frame2"].document.location = frame2;

parent.frames["frame3"].document.location = frame3;

}

</script>

or

The JavaScript/link in one-

... onClick="javascript: parent.parent.framename_goes_here.location='frame_2_filename.ext';parent.parent.framename_goes_here.location='frame_3_filename.ext'"

Hope this gives you an idea!

Note: In the onClick attribute, it says 'java script:' with a space which is incorrect. Just delete the space.
×

Success!

Help @eclipse88 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.17,
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,
)...