Displaying link in one frame & data in another

J

jamiil

I have a webpage that has three frames; Banner, Menu and Data, I would
like the user to clink on the linked icon in the Menu frame and
display the webpage in the Data frame.
How do I do this?
This is what I have done:
--- snip ---
<td style="vertical-align: top; width: 30px;"><a
href="http://www.onlinenewspapers.com/"><img alt="News Papers"
title="News Papers" src="../pix/fire.gif"
style="border: 0px solid ; width: 36px; height: 25px;"></a><br>
</td>
--- end ---
This does not work since the webpage is displayed in the Menu frame;
thus removing the menu from the user.

Thanks in advance.
 
J

jamiil

I did some more research and I modified the snip to:

<td style="vertical-align: top; width: 30px;">
<a href="http://www.onlinenewspapers.com/" target="showframe">
<img alt="News Papers"
title="News Papers" src="../pix/fire.gif"
style="border: 0px solid ; width: 36px; height: 25px;"></a><br>
</td>

But this lounches a new window, which is not what I want.

Thanks folks
 
J

jamiil

Sorry that is not write:

<td style="vertical-align: top; width: 30px;">
<a href="http://www.onlinenewspapers.com/" target="./
Frame_3.html"> <img alt="News Papers"
title="News Papers" src="../pix/fire.gif"
style="border: 0px solid ; width: 36px; height: 25px;"></a><br>
</td>

Please note that the name of the file where the data will be displayed
is Frame_3.html
 
T

Toby A Inkster

jamiil said:
target="showframe"

The target should be the name of what you referred to as your "Data
frame". The name is defined in the frameset document.

But frames are horrible. Don't use them. Can you name one major website
that uses frames? Probably not. There are good reasons why they do not.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
 
J

Jonathan N. Little

jamiil said:
Sorry that is not write:

<td style="vertical-align: top; width: 30px;">
<a href="http://www.onlinenewspapers.com/" target="./
Frame_3.html"> <img alt="News Papers"
title="News Papers" src="../pix/fire.gif"
style="border: 0px solid ; width: 36px; height: 25px;"></a><br>
</td>

Please note that the name of the file where the data will be displayed
is Frame_3.html

Firstly, frames are a bad idea for a host of reasons often discussed in
this NG and a quick search will enlighten.

Secondly, that a a completely invalid value for the target attribute.
The target value should be the *name* of the frame the link's href is
supposed to be directed to.
 
J

jamiil

Thank you all for the good help.
But I am afraid that due to my little knowledge of HTML, a more
extended explanation is need; not only from you, but also from me.
However, before I go any further, I want you to know that it is true
what you have said about frames, and I completely agree with you two
[jonathan & toby].
Now, to the task at hand. I have a directory tree that looks like
this:
/home/myname/project/html
|_____ index.html
/home/myname/project/html/doc
|_____
Frame_1.html
|_____
Frame_2.html
|_____
Frame_3.html
|_____
Frame_4.html
/home/myname/project/html/pix
|_____ bunch of
pictures
/home/myname/project/html/javascript
|_____
not much, yet!

I am not sure of using the right names for the 'target frame', please
do have a look and let me know if I am on the right track.
Thanks sooooo very much!!


Frame_1.html
~~~~~~~~~~~~
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title>Banner</title>
</head>
<body style="color: rgb(0, 0, 0); background-color: rgb(0, 0, 0);"
alink="#000099" link="#000099" vlink="#990099">
<table
style="background-color: rgb(0, 0, 0); width: 100%; text-align:
left;"
border="1" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="vertical-align: top;"><img alt=""
src="../pix/all.gif"
style="width: 126px; height: 141px;"><br>
</td>
<td
style="vertical-align: top; font-family: helvetica,arial,sans-serif;
text-align: center;"><big
style="color: rgb(255, 102, 102);"><big><span
style="font-weight: bold;"><big style="color: rgb(255, 255,
153);"><big><blink>My
merci overpowers my anger</blink></big></big></span></big></big></td>
<td style="vertical-align: top; text-align: right;"><img alt=""
src="../pix/all.gif" style="width: 126px; height: 141px;"><br>
</td>
</tr>
</tbody>
</table>
<br>
</body>
</html>

Frame_2.html
~~~~~~~~~~~
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title>Fram_2.html</title>
</head>
<body style="color: rgb(0, 0, 0); background-color: rgb(153, 153,
0);"
alink="#000099" link="#000099" vlink="#990099">
<table
style="background-color: rgb(153, 153, 0); text-align: left; width:
213px; height: 544px;"
border="0" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td
style="background-color: rgb(153, 153, 0); vertical-align: top;
width: 30px;"><a
href="http://mail.google.com/mail/"><img alt="GMail" title="GMail"
src="../pix/mailslot.gif"
style="border: 0px solid ; width: 36px; height: 25px;"></a><br>
</td>
<td style="vertical-align: top;"><span
style="font-weight: bold; color: rgb(51, 255, 51);">GMAIL</span><br>
</td>
</tr>
<tr>
<td style="vertical-align: top; width: 30px;"><a
href="http://www.hotmail.com"><img alt="" title="Hotmail"
src="../pix/mailslot.gif"
style="border: 0px solid ; width: 36px; height: 25px;"></a><br>
</td>
<td style="vertical-align: top;"><span
style="font-weight: bold; color: rgb(51, 255, 51);">Hotmail</
span><br>
</td>
</tr>
<tr>
<td style="vertical-align: top; width: 30px;"><a
href="https://login.yahoo.com/config/
login_verify2?.intl=ca&amp;.src=ym&amp;.done=http%3a%2f
%2fca.f384.mail.yahoo.com%2fdc%2flaunch%3fsysreq%3dignore"><img
alt="Yahoo" title="Yahoo" src="../pix/mailslot.gif"
style="border: 0px solid ; width: 36px; height: 25px;"></a><br>
</td>
<td style="vertical-align: top;"><span
style="font-weight: bold; color: rgb(51, 255, 51);">Yahoo</span><br>
</td>
</tr>
<tr>
<td style="vertical-align: top; width: 30px;"><a
href="http://www.google.ca/ig?
hl=en&amp;ie=UTF-8&amp;oe=UTF-8&amp;tab=iw&amp;q="><img
alt="Google cafe" title="Google cafe" src="../pix/Earth001.gif"
style="border: 0px solid ; width: 36px; height: 25px;"></a></td>
<td style="vertical-align: top;"><span style="font-weight:
bold;"><span
style="color: rgb(51, 255, 51);">Google cafe</span></span><br>
</td>
</tr>
<tr>
<td style="vertical-align: top; width: 30px;">
<a href="http://www.onlinenewspapers.com/" target="./
Frame_3.html"> <img alt="News Papers"
title="News Papers" src="../pix/fire.gif"
style="border: 0px solid ; width: 36px; height: 25px;"></a><br>
</td>
<td style="vertical-align: top;"><span
style="color: rgb(51, 255, 51); font-weight: bold;">News Papers</
span><br>
</td>
</tr>
<tr>
<td style="vertical-align: top; width: 30px;"><img
alt="Banking"
title="Banking" src="../pix/Time001.gif"
style="width: 36px; height: 25px;"></td>
<td style="vertical-align: top;"><span style="font-weight:
bold;"><span
style="color: rgb(51, 255, 51);">Banking</span></span><br>
</td>
</tr>
<tr>
<td style="vertical-align: top; width: 30px;"><a
href="http://www.dictionary.com"><img alt="Dictionary"
title="Dictionary" src="../pix/dictionary.png"
style="border: 0px solid ; width: 36px; height: 25px;"></a><br>
</td>
<td style="vertical-align: top;"><span style="font-weight:
bold;"><span
style="color: rgb(51, 255, 51);">Educational</span></span><br>
</td>
</tr>
<tr>
<td style="vertical-align: top; width: 30px;"><img
alt="Islamic resources" title="Islamic resources"
src="../pix/islam.gif" style="width: 36px; height: 25px;"><br>
</td>
<td style="vertical-align: top;"><span style="font-weight:
bold;"><span
style="color: rgb(51, 255, 51);">Pesonal stuff</span></span><br>
</td>
</tr>
<tr>
<td style="vertical-align: top; width: 30px;"><br>
</td>
<td style="vertical-align: top;"><br>
</td>
</tr>
<tr>
<td style="vertical-align: top; width: 30px;"><br>
</td>
<td style="vertical-align: top;"><br>
</td>
</tr>
<tr>
<td style="vertical-align: top; width: 30px;"><br>
</td>
<td style="vertical-align: top;"><br>
</td>
</tr>
</tbody>
</table>
<br>
<br>
</body>
</html>

Frame_3.html
~~~~~~~~~~~
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title>Image</title>
</head>
<body style="color: rgb(0, 0, 0); background-color: rgb(0, 0, 0);"
alink="#000099" link="#000099" vlink="#990099">
<div style="text-align: center;"><img title="Med" alt=""
src="../pix/blue-picture.jpg" style="width: 788px; height: 482px;"></
div>
</body>
</html>


Frame_4.html
~~~~~~~~~~~~
<html>

<frameset cols="22%,78%">

<frame noresize="noresize" src="Frame_2.html">
<frame noresize="noresize" src="Frame_3.html">
</frameset>

</html>

Index.html
~~~~~~~~
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title>My Home Page</title>
</head>

<br>
<frameset rows="26%,74%">
<frame noresize="noresize" src="./doc/Frame_1.html">
<frame noresize="noresize" src="./doc/Frame_4.html">
</frameset>
<br>

</html>
 
J

J.O. Aho

jamiil said:
Now, to the task at hand. I have a directory tree that looks like
this:
Frame_4.html
~~~~~~~~~~~~
<html>

<frameset cols="22%,78%">

<frame noresize="noresize" src="Frame_2.html">
<frame noresize="noresize" src="Frame_3.html">
</frameset>

</html>

As I understood, you had a page that looked something like:

TTTTTTTTTTTT
TTTTTTTTTTTT
MMMMDDDDDDDD
MMMMDDDDDDDD
MMMMDDDDDDDD
MMMMDDDDDDDD

So why don't you do all in one frameset?
The main trouble you have is that you haven't named the frames, and therefore
you can't target a frame.

<FRAMESET rows="100, *">
<FRAME name="title" src="Frame_3.html">
<FRAMESET cols="22%, *">
<FRAME name="menu" src="Frame_2.html">
<FRAME name="main" src="Frame_1.html">
</FRAMESET>
</FRAMESET>


In the Frame_2.html you use anchors like

<a href="http://www.example.net" target="main">The example net page</a>

if you want them to be displayed in the big frame.

if you want to replace your menu with another one, then use target="menu" and
if you want a new title then use target="title".
 
J

Jonathan N. Little

jamiil said:
Thank you all for the good help.
But I am afraid that due to my little knowledge of HTML, a more
extended explanation is need; not only from you, but also from me.
However, before I go any further, I want you to know that it is true
what you have said about frames, and I completely agree with you two
[jonathan & toby].
Now, to the task at hand. I have a directory tree that looks like
this:
/home/myname/project/html
|_____ index.html
/home/myname/project/html/doc
|_____
Frame_1.html
|_____
Frame_2.html
|_____
Frame_3.html
|_____
Frame_4.html
/home/myname/project/html/pix
|_____ bunch of
pictures
/home/myname/project/html/javascript
|_____
not much, yet!

I am not sure of using the right names for the 'target frame', please
do have a look and let me know if I am on the right track.
Thanks sooooo very much!!
<snip>

WHOA! STOP!
1) Post a URL to an online example not tons of pasted code

2) You need to have a basic understanding of HTML else this in not going
to work, I saw that you did not name your frames in the frameset so your
are doomed from the start.

3) Why are you using frames in the first place? Maybe you don't (have
to, need to, or should) use frames.

4) If you have "little knowledge of HTML" maybe you should do a little
bit of reading before your start, /like those toys your must assemble
for the kids at Christmas go together much easier when your read the
instructions first!/ It is the same with webpages! Go through the
Beginners tutorials at www.htmldog.com

5) If you are still lost, find another site on the web that looks like
what you are trying to do and look at the source. Can go a long way to
help, but please do the tutorials at www.htmldog.com because there are a
lot of very bad sites out there. Start out right!
 
J

jamiil

Yes, you are absolutely right, a bit of reading will do a lot of good,
not only to me, but to you as well. As I said "...I want you to know
that it is true what you have said about frames, and I completely
agree with you two [jonathan & toby]."

Yes, I realize that posting a URL would be much better than the few
lines of code, However, I don't have the luxury and/or privilege of
having a website. I can hardly feed my cat with the money I make,
ha,ha,ha. So, I am sorry for the few lines of code.

On another front, thanks for the webpage you suggested, I have been
visiting so many websites and reading so many webpages; as I said, I
know little, but there are certain areas, in the little bit that I
know, that are a bit grayish still, thus the posting on this subject.
Please note, I am writing this page only so that I can learn the turns
and corners of 'html frames', that's it.

Thank you so very much for the help, I will continue my reading and
developing my knowledge in html thanks to people like you who take the
time to point me in the right direction.
 
J

Jonathan N. Little

jamiil said:
Yes, you are absolutely right, a bit of reading will do a lot of good,
not only to me, but to you as well. As I said "...I want you to know
that it is true what you have said about frames, and I completely
agree with you two [jonathan & toby]."

Okay "...I want you to know that it is true what you have said about
frames"

What is true, said more than one thing and you neither quoted nor
express exactly what thing about frames that you are referring to.
Yes, I realize that posting a URL would be much better than the few
lines of code, However, I don't have the luxury and/or privilege of
having a website. I can hardly feed my cat with the money I make,
ha,ha,ha. So, I am sorry for the few lines of code.

A 200+ is not a few and if you are developing a *web* page where do you
precisely intend to put it? The Web? Also, how much is too much? is
$0.00 too much? You could use a *free* server for just development,
testing, and Usenet examples!
On another front, thanks for the webpage you suggested, I have been
visiting so many websites and reading so many webpages; as I said, I
know little, but there are certain areas, in the little bit that I
know, that are a bit grayish still, thus the posting on this subject.
Please note, I am writing this page only so that I can learn the turns
and corners of 'html frames', that's it.

My advice is don't bother. Frames were a 'hack' added back in the 90's
when web development was in its infancy and server-side scripting was
not readily available. They have always be problematic. If you are
learning, learn circa 2007 not circa 1995. If you are learning to drive
an automobile would you bother to study how to use the spark-advance and
throttle levers?
Thank you so very much for the help, I will continue my reading and
developing my knowledge in html thanks to people like you who take the
time to point me in the right direction.

Sure do the tutorials, do some practice pages, and if you have
questions, put up some example code somewhere and come armed with your
question and URL...
 
J

jamiil

"WHOA! STOP! "

Sorry if I offended you in any way, RELAX man!!

jamiil said:
Yes, you are absolutely right, a bit of reading will do a lot of good,
not only to me, but to you as well. As I said "...I want you to know
that it is true what you have said about frames, and I completely
agree with you two [jonathan & toby]."

Okay "...I want you to know that it is true what you have said about
frames"

What is true, said more than one thing and you neither quoted nor
express exactly what thing about frames that you are referring to.


Yes, I realize that posting a URL would be much better than the few
lines of code, However, I don't have the luxury and/or privilege of
having a website. I can hardly feed my cat with the money I make,
ha,ha,ha. So, I am sorry for the few lines of code.

A 200+ is not a few and if you are developing a *web* page where do you
precisely intend to put it? The Web? Also, how much is too much? is
$0.00 too much? You could use a *free* server for just development,
testing, and Usenet examples!


On another front, thanks for the webpage you suggested, I have been
visiting so many websites and reading so many webpages; as I said, I
know little, but there are certain areas, in the little bit that I
know, that are a bit grayish still, thus the posting on this subject.
Please note, I am writing this page only so that I can learn the turns
and corners of 'html frames', that's it.

My advice is don't bother. Frames were a 'hack' added back in the 90's
when web development was in its infancy and server-side scripting was
not readily available. They have always be problematic. If you are
learning, learn circa 2007 not circa 1995. If you are learning to drive
an automobile would you bother to study how to use the spark-advance and
throttle levers?


Thank you so very much for the help, I will continue my reading and
developing my knowledge in html thanks to people like you who take the
time to point me in the right direction.

Sure do the tutorials, do some practice pages, and if you have
questions, put up some example code somewhere and come armed with your
question and URL...
 
J

Jonathan N. Little

jamiil said:
"WHOA! STOP! "

Sorry if I offended you in any way, RELAX man!!

No, that was to emphasize that you should not dump all your markup in a
post! Use a URL and post annotated relevant snippets to point out the
trouble spots.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top