Solved

Link to an anchor in a frame

Posted on 2000-03-11
10
337 Views
Last Modified: 2010-04-09
Hi,

I have got a page with frames. It is rather standard: the left
frame is an index, in the right frame the page with the info is
loaded. The index only links to named anchors in the right page.
I have e.g. added the tag: <A NAME="find">Find</A>

My question: is it possible to link to "Find" from another
page that DOESN'T have a frame?


<frameset cols=100,*>
<frame src="index.html" name="index">
<frame src="test.html" name="test">
</frameset>


I tried to link to Find via: <A HREF="test.html#find">To: Find</A>
But this link and all others will just open test.html but not
at the place I want it: <A NAME="find">Find</A>

The page that I use to link to test.html really can't have a
frame. So I suspect this can't be done and I will have to use
a table for the index instead.

I appreciate any suggestions

0
Comment
Question by:zink
  • 3
  • 2
  • 2
  • +2
10 Comments
 
LVL 2

Expert Comment

by:HolySpirit
ID: 2609025
zink,
I think u can use <A> tag to link to the "master" document that contain these code :
<frameset cols=100,*>
<frame src="index.html" name="index">
<frame src="test.html" name="test">
</frameset>

and don't just link to test.htm so that IE can load the frame.
-- Holy Spirit
0
 
LVL 8

Accepted Solution

by:
jbirk earned 100 total points
ID: 2609035
Try not putting any text between between the anchor name...
<A NAME="find"></A>
That seems to work for me...

As for linking to a framed page...  if you want the point in the document "find" to be where it starts, and also have it start in it's frames, then link to a frameset page (like "index2.html") and have it's HTML code look like this:
<frameset cols=100,*>
<frame src="index.html" name="index">
<frame src="test.html#find" name="test">
</frameset>

-Josh
0
 
LVL 1

Expert Comment

by:technoman
ID: 2609270
You can try this:

<FRAMESET>
 <FRAME SRC="INDEX.HTML" NAME="INDEX">
 <FRAME SRC="RIGHT.HTML" NAME="RIGHT">
</FRAMESET>

in the right.html file, in order to go to index anchor find, do this:

<A HREF="INDEX.HTML#FIND" TARGER="INDEX">To:Find</A>

just be sure to have in index.html

<A NAME="FIND"></A>

Hope this help.
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 1

Expert Comment

by:technoman
ID: 2609272
ops! it should be <A HREF="INDEX.HTML#FIND" TARGET="INDEX">To:Find</A>

this tells the broser where the result should be reflected using the TARGET attribute.
0
 

Author Comment

by:zink
ID: 2610550
Thanks for your input technoman, but I thinks I didn't make myself clear. I want to link from a page with NO frames to an anchor in the right.html file.

Your solution let me link from the right.html file to index.html. This is not what I wanted (although I appreciate the lesson, I didn't know how to do this; might need it in the future :) So I will have to reject your answer.

Josh, I tried what you suggested.. but it didn't work  (I use both Explorer 4 and Netscape 4).
I also placed several links on test.html (the right frame) to anchors on that same page:

<A HREF="test.html#anchor1"></A>
<A HREF="#anchor1"></A>
<A HREF="test.html#anchor2"></A>

After clicking any of these links, the anchor would  be at the top of the page. But the location still was help.html and not help.html#anchor1 or help.html#anchor2l

If the browser doesn't show the # anchor it is also not possible to link to it.



0
 
LVL 8

Expert Comment

by:jbirk
ID: 2610602
Could you provide a link to your pages that aren't working.  That way I can try and diagnose the problem with the whole picture in mind...  It's possible that something else is affecting this and causing it not to work.

-Josh
0
 
LVL 32

Expert Comment

by:Batalf
ID: 2611640
When a page are "loaded" into a page with frames, you could have links in it which would open in an other frame.

Like Tecnoman proposed.

<A HREF="INDEX.HTML#FIND" TARGET="INDEX">To:Find</A>

It doesn't matter if the page have frames or not.

Just be aware of lowercase, uppercase and so on if your page is on a unix-machine.

Batalf

0
 
LVL 32

Expert Comment

by:Batalf
ID: 2611653
or maybe just like this :

<A HREF="index.html" TARGET="index">To:Find</A>
0
 

Author Comment

by:zink
ID: 2614772
Thank you all.

Josh, I didn't have time to look what was wrong yesterday.. but I just saw that I forgot to NOT place any text between the anchor.. like you told me to. It works fine now :)
0
 
LVL 8

Expert Comment

by:jbirk
ID: 2615778
I thought that might have caused a problem :)

Glad it works now!

-Josh
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

775 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question