/    Sign up×
Community /Pin to ProfileBookmark

1 "click" loading 2 frames

hey,

does anyone know how to change the content of 2 frames from 1 “click”?

I have 4 frames on my page and on specific buttons I need the <a href> to load two different pages in 2 different frame.

I found this code on the net.. wich looks fine.. I guess.. but it doesn’t work.. if it does.. I obviously don’t understand it ?

<script language=”JavaScript”><!–
function functionName(fileName1,fileName2) {
parent.frameName1.location.href = fileName1;
parent.frameName2.location.href = fileName2;
}
//–></script>

<a href=”javascript:functionname(‘file1.html’,’file2.html’)”>Go</a>

can anyone help?..
thanks

mel

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@96turnerriFeb 07.2004 — <script language="JavaScript"><!--

function functionName(fileName1,fileName2) {

parent.frameName1.location.href = fileName1;

parent.frameName2.location.href = fileName2;

}

//--></script>

<a href="javascript:functionname('file1.html','file2.html')">Go</a>

you need to change [code=php]frameName1 & 2[/code] to the names of you frames. eg <iframe name="one"... you would use one.

and change this href="javascript:functionname('file1.html','file2.html')" to the two files you wish to open file1.html opens in first frame so say page.php and file2.html in the second so say downloads.asp
×

Success!

Help @batmel 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.19,
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,
)...