PDA

View Full Version : Multiple Targets link



almarenan
11-15-2004, 11:47 PM
I'm wondering if there's a way (javascript or else) to make a link have 2 actions at the same time. For example, when I use a link on a frame, it changes (loads) 2 other frames simultaneously ? I'm not sure I'm explaining myself clearly but...

ddadmin
11-16-2004, 02:39 AM
Certainly. The general technique looks like this:


<a href="#" onClick="dothis(); dothat(); return false">A link</a>

As you can see, simply seperate the functions you want to invoke with a semicolon. Regarding your question on loading two frames with one link, the following tutorial explains it best: http://www.javascriptkit.com/javatutors/twoframes1.shtml

Nate_Bro
11-16-2004, 04:35 AM
I have also found that using
<
a href="#" on Click="dothis(), dothat()">A link</a>

also works in some browsers. i would stick to using a ; instead of a ,

<a href="#" onClick="dothis(); dothat(); return false">A link</a>