HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Linking to anchor tags within an iframe
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Frame
View previous topic :: View next topic  
Author Message
Caldar



Joined: 20 Feb 2005
Posts: 3

PostPosted: Sun Feb 20, 2005 10:29 pm     Linking to anchor tags within an iframe Reply with quote

I have a list of links on a web page containing an iframe. These links are meant to target specific anchor tags within the HTML document that is loaded into the iframe. The effect I am after is similar to the anchor tag links you often find an an FAQ page, where clicking on the question makes the document jump down to the answer. I am trying to do the same thing, but have the iframe text jump to the appropriate anchor tag (see code sample below). Unfortunately, the links do not seem to be working as I expected them to. Any suggestions?

Code snippets from parent page:
Code:
<IFRAME NAME="iText" WIDTH="500" HEIGHT="350" SRC="answers_txt.html" FRAMEBORDER="0"></IFRAME>

<A HREF="answers_txt.html#answer1" TARGET="iText">Question One</A><BR>
<A HREF="answers_txt.html#answer2" TARGET="iText">Question Two</A><BR>
<A HREF="answers_txt.html#answer3" TARGET="iText">Question Three</A>


Anchor tag example from "answers_txt.hml" document:
Code:
<A NAME="answer1"></A>


This method works in non-iframe instances, but I can not get it to work in iframes. Is it possible, am I missing something, or am I out of luck because it is not implemented?

Thanks in advance for the help.

- Caldar
chrisxkelley



Joined: 07 Dec 2004
Posts: 246

PostPosted: Mon Feb 21, 2005 2:46 am     Reply with quote

you could try just the anchor name in the url

Code:
<A HREF="#answer1" TARGET="iText">Question One</A><BR>
<A HREF="#answer2" TARGET="iText">Question Two</A><BR>
<A HREF="#answer3" TARGET="iText">Question Three</A>


seems to me that it should work, but maybe iframes dont like that. what browser are you testing it on?
Caldar



Joined: 20 Feb 2005
Posts: 3

PostPosted: Mon Feb 21, 2005 8:49 am     Reply with quote

My mistake. The original method does work, I mistakenly was targeting a copy of the document that did not have the anchor tags. I knew that I put them in, but it was in a different copy of the document. Doh! Too many late nights.

Thanks for the help!
chrisxkelley



Joined: 07 Dec 2004
Posts: 246

PostPosted: Mon Feb 21, 2005 11:04 pm     Reply with quote

Quote:
Doh! Too many late nights.

ha. i'm with you there on that.

glad you solved it


cheers,
chris
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Frame All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial