473,667 Members | 2,789 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to open links in different Frames

2 New Member
I've been searching the web for the answer to this question, and I've found people addressing my question, but the answers don't help me. I must be missing a step or something.

I'm trying to build a simple website with HTML. I learned HTML in high school a few years ago, and due to lack of use, I've forgotten most of it. My layout is to have 3 frames. One at the top that I'll use as a title/header. One on the left, which will be my links frame, where I will list all of my links. The main part of the page will be place on the bottom right. I want to be able to click on a link from my frame on the left and have it open on the frame on the right. From what I read I have to name my frames. Ok, I can do that, but where I name the frames and where the links are are in two different files. How can I do this?


This is what I have (I know it's not much...I'm extremely rusty).


Header File (the very top of the page):
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body style="background-color:#eec591;">
  3. <center>
  4. <h1>TITLE</h1>
  5. </center>
  6. </body>
  7. </html>

Links/Navigation (on the bottom left of the page):
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body style="background-color:#eec591;">
  3. NAVIGATION<br>
  4. <a href="drowningtosurvive.html" target="main">Drowning To Survive</a>
  5. </body>
  6. </html>

Main Body of the page (on the bottom right of the page):
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body style="background-color:#eec591;">
  3. Here is where stuff goes...
  4. </body>
  5. </html>

Then, this is the file that pulls all the frames together in 1 page:
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <frameset border=0 frameborder=0 framespacing=0 rows="10%,*">
  3. <frame src="Header.html">
  4. <frameset cols="20%,*%">
  5. <frame src="Navigation.html" name="Navigation">
  6. <frame src="Home.html" name="Main">
  7. </frameset>
  8. </frameset>
  9. </html>




I'm sure there is a much easier way to post this issue, I just don't know how. In the "Links/Navigation" section I want to click on my "drowningtosurv ive.html" link and have it open in my "Main Body" frame.
Apr 26 '10 #1
2 3825
Death Slaught
1,137 Top Contributor
The reason you probably haven't been able to find a working solution is because frames are an unnecessary headache. The effect you're wanting can be achieved with little effort. This is something that used to be on W3schools.com. Whether it still is there I have no idea, but the code is still valid. It isn't exactly what you're asking for but it should give you a basic idea of how to achieve the desired affect. Onmouseover would become onmouseclick and instead of calling for text you would call for the webpage you want the link to display.


Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
  2.  
  3.  
  4. <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  5.  
  6.  
  7.   <head> 
  8.     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
  9.     <title></title>
  10.  
  11.      <style type="text/css">
  12.        table {
  13.                background:black;
  14.        }
  15.        a {
  16.                text-decoration:none;
  17.                color:#000000;
  18.        }
  19.        th {
  20.                width:150px;
  21.                background:#FF8080;
  22.        }
  23.        td {
  24.                font:bold;
  25.                background:#ADD8E6;
  26.        }
  27.      </style>
  28.  
  29.      <script type="text/javascript">
  30.        function gettip(txt) {
  31.            document.getElementById('tip').innerHTML=txt;
  32.        }
  33.  
  34.        function reset() {
  35.            document.getElementById('tip').innerHTML=" ";
  36.        }
  37.      </script>
  38.  
  39.   </head>
  40.  
  41. <body>
  42.  
  43.   <p>Mouse over the links to see their descriptions</p>
  44.  
  45.   <table width="400px">
  46.     <tr>
  47.       <th>
  48.         <a href="http://www.w3schools.com" onmouseover="gettip('W3Schools is the best Web Developers resource on the Web')"                             onmouseout="reset()">W3Schools.com</a>
  49.       </th>
  50.       <td rowspan="3" id="tip"> </td>
  51.     </tr>
  52.     <tr>
  53.       <th>
  54.         <a href="http://www.microsoft.com" onmouseover="gettip('Internet Explorer is winning the browser war')"
  55. onmouseout="reset()">Internet Explorer</a>
  56.       </th>
  57.     </tr>
  58.     <tr>
  59.       <th>
  60.         <a href="http://my.netscape.com" onmouseover="gettip('The Navigator is Netscapes browser tribute to web surfers')"
  61. onmouseout="reset()">Netscape Navigator</a>
  62.       </th>
  63.     </tr>
  64.   </table>
  65.  
  66. </body>
  67.  
  68. </html>
I hope this helps,
{\_/}
(' . ')
(")[DEATH](")
(")(")


PS - In this example a table is used for the layout of the page. I highly recommend NOT doing the same in your webpage. The same affect can be accomplished with the div element quite easily.
May 5 '10 #2
MosaicMan
2 New Member
Thank you for the reply and solution.
May 6 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

40
2922
by: JohnnyCJohnny | last post by:
Is it pretty safe to say that almost all web surfers now use browsers that are Frames compatible? What are most people using these days? IE? Thanks
14
11074
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a window.open function? I would prefer not to create a separate HTML page. So far all I have is the basic var cwin = window.open('images/KJV-THANKS.gif', 'Thanks', 'width=243,height=420,'); cwin.focus();
10
3814
by: Michael | last post by:
Hi, I'm trying to load a page external to my website into my frame. I have several links on my page that work fine but when connecting to the site http://www.formulaboats.com I am forced out of my frames and the above link is opened in the whole window. I'm assuming the formualboats site has stopped people from opening their pages in frames but my questions are 1. How did they do this? Is it an HTML thing or a javascript thing? 2. Is...
5
8812
by: chris.poirier | last post by:
Does anyone know how I could make an iframe so that the links in the frame page are disabled ... or if this is possible? Any help is appreciated.
2
1349
by: Kailas | last post by:
Hi All, I have a web page which has links to external sites. When user clicks on the external link, I want to display a banner on the top the window (5% of the window, to display link to take user back to my original page) and in the remaining window load the external site. What is the best way to achieve this?. Should I use frames or JavaScripts?. I am new to JavaScript. Your help is greately appreciated. Thanks Kailas
44
9429
by: Viken Karaguesian | last post by:
Hello all, On occasion I want to open hyperlinks (images, etc.) in a new window. In the past, I've used target="_blank" to open the link in a new window. However, using the "target" attribute causes my pages to fail validation (strict doctype). The validator says "There is no attribute 'target'.." So...how do I open a link in a new window, without Javscript, and pass strict validation?
7
3958
by: SHC | last post by:
I'm in need of some javascript to load two pages into two seperate iframes which are on two seperate and different pages. Rather complicated I know (and easier done in one frameset), but caused by some limitation issues of SharePoint. To help:
7
1817
by: funktacular | last post by:
Hi- I have script that works fine when I run it from a server, but I need to be able to load the page and have it work from my hard drive. However, it seems the when the url changes from http://www.mydomain.com/default.html to file:///D:/folder_name/default.html that the browser thinks the frames are coming from different domains. I'm still pretty new to javascript and I am wondering if there is a way around this so I can load from my...
1
1508
by: mark.martinez2 | last post by:
Here's my problem: It is necessary to have people enter in direct links to pages on my site, which is frame-based, but when they go to any page that isn't the home page, the frameset doesn't load, so they're only presented with the content of the main frame, not the top logo or sidebar frames. Is there a quick Javascript fix for this? I tried to Google search for a solution, but couldn't come up with the right search terms. Also, when...
7
1932
by: swapcool | last post by:
Hi, I am a page having a menu and a few frames life below. The links in menu open in F3 frame. I also have back/forward buttons in F1 frame. ________________________ ____________F1_________| | F2 |................................ | | .... |................................ | | M | .............F3...............| | E | ...............................|
0
8458
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8888
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8790
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8650
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7391
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6206
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5677
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4202
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.