Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 359
  • Last Modified:

Link to an anchor in a frame

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
zink
Asked:
zink
  • 3
  • 2
  • 2
  • +2
1 Solution
 
HolySpiritCommented:
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
 
jbirkCommented:
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
 
technomanCommented:
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
technomanCommented:
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
 
zinkAuthor Commented:
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
 
jbirkCommented:
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
 
BatalfCommented:
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
 
BatalfCommented:
or maybe just like this :

<A HREF="index.html" TARGET="index">To:Find</A>
0
 
zinkAuthor Commented:
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
 
jbirkCommented:
I thought that might have caused a problem :)

Glad it works now!

-Josh
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now