EchoEcho.Com Homepage
Web Hosting - As Reliable As It Gets!
   Home > Tutorials > Javascript > Advanced


 Tutorials 
 D-Zine Articles 
 Online Tools 
 Free Resources 
 References 
 Quiz 
 Hosting 

















  Multiple Links :
THE CODE








Assuming you want a link to open Yahoo in a frame called bannerframe and AltaVista in a frame called mainframe the code looks like this:

<a href="#" onClick="
parent.bannerframe.location='http://www.Yahoo.com';
parent.mainframe.location='http://www.altavista.com';
return false;
">


As you can see, we simply add a:

parent.framename.location='linkname';

for each page we want to open. You can, of course, add as many links as you like.


NOTE:
The onClick event is enclosed by double quotes.
The javascript links are enclosed by single quotes.


The return false statement makes sure that the browser doesn't even try to interpret the html link (pointing to #).
This is necessary because sometimes a link to an unexisting anchor forces the browser to go to the top of the page (which might not be what we want).

 << PREVIOUS
READ MORE >>  
















DEVELOPER TIP!
FACT:
The scrollbar takes up about 30 pixels.
TIP:
If you're designing for an 800px screen width don't use more than 770 pixels!





     "Better Than Books - As Easy As It Gets!"


On EchoEcho: D-Zine Articles | Tutorials | Online Tools | Free Resources | References | Quiz | HostingAbout EchoEcho