Click to See Complete Forum and Search --> : Frames
cH3wY
05-12-2006, 03:46 AM
I have two frames using this configuration
<HTML>
<TITLE>Contents</TITLE>
<FRAMESET COLS="30%,70%">
<FRAME SRC="contents.htm">
<FRAME SRC="blank.htm">
</FRAMESET>
</HTML>
I want a hyperlink in the contents.htm which is shown on the left to open in the right frame, for example a hyperlink to google on contents.htm to then refresh/change/link the second frame what currently has blank.htm open to google.
anyhelp appreciated
thanks
cH3wY
mathew.tew@gmail.com
You need to name the frames, then use the target attribute
<HTML>
<TITLE>Contents</TITLE>
<FRAMESET COLS="30%,70%">
<FRAME SRC="contents.htm" name="contents">
<FRAME SRC="blank.htm" name="extra">
</FRAMESET>
</HTML>
----
<a href="http://google.com" target="extra">Link</a>
KDLA
the tree
05-12-2006, 10:39 AM
Y'know, framesets can be built to w3c standards, there's no reason to skip on the coding.<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>
The site: Contents
</title>
<meta http-equiv="Content-Type" content=
"text/html; charset=us-ascii">
</head>
<frameset>
<frame src="contents.htm" id="contents">
<frame src="extras.htm" id="extras">
<noframes>
<body>
<p>
Head straight to our <a href="contents.htm">contents
page</a>.
</p>
</body>
</noframes>
</frameset>
</html>
cH3wY
05-12-2006, 10:57 AM
ok i just tried it and it doesnt work. the google link just opens in a new window when i want it too open in the frame on the right called content
I have 3.html files in a folder. pictures.html, pindex.html, pcontent.html
I have editted it so it might be a simple mistake but i do think that the target in the hyperlink is wrong in content? i have highlighted it
I have put this code into pictures.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>Fa1.uK^ Pictures BETA v1.1</title>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<frameset>
<FRAMESET COLS="30%,70%">
<frame src="pindex.html" id="index">
<frame src="pcontent.html" id="content">
<noframes>
<body>
<p>
Head straight to our <a href="www.google.com">contentspage</a>.
</p>
</body>
</noframes>
</frameset>
</html>
I have then just put simple background colours into the other two with the link tree said soo...
pindex.html looks like this
<HTML>
<TITLE>Fa1.uK^ Pictures BETA v1.0</TITLE>
<BODY BGCOLOR="FFD700">
<a href="http://www.google.com" target="content">Google</a>
</HTML>
pcontents.html looks like this
<HTML>
<TITLE>Fa1.uK^ Pictures BETA v1.0</TITLE>
<BODY BGCOLOR="F8F8FF">
</HTML>
If the target in pindex is not wrong then do i need to add the w3c doctype at the top of each one? or have i got the complete wrong idea about frames going? :'(?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
cH3wY
mathew.tew@gmail.com
the tree
05-12-2006, 12:41 PM
You might want to try switching 'id' for 'name'. You should always have an apropriate doctype at the top of every HTML document.
id="" should be name="" for the target to work.
http://www.w3.org/TR/REC-html40/present/frames.html#h-16.3
KDLA