/    Sign up×
Community /Pin to ProfileBookmark

link between 2 iframes on the same page

I have 2 iframes on the same page: one has a doc. with a list of names and another a doc. with info. corresponding to each name. Clicking on a link in frame 1 takes you to an anchor in the doc. in frame 2.

Doing this w/ html didn’t work in IE for Windows, but did work in IE, Firefox and Safari for Mac. Such a link looked like this:

[code=html]<a href=”secondDoc.html#someAnchor” target=”frameTwo”>Link</a>[/code]

So I tried a javascript approach. This does work in IE and Safari for Mac, but in Firefox it ALSO clears the first frame and shows the address of the html document that has correctly loaded into the second frame!

[code=html]<a href=”javascript:top.frameTwo.location=’secondDoc.html#someAnchor'”>Link</a>[/code]

I hope I’m on the right track with the javascript approach, but wonder what the problem is that causes frame1 to clear out when the link is clicked. Thanks for any help.

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @trick_of_light 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.18,
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,
)...