anchors with iFrames

Discussion in 'HTML & Website Design' started by nicknack, May 30, 2006.

  1. #1
    hi everyone,

    i am having same trouble with anchors and iframes.

    i have for example, page2.html in an iframe within page1.html document.

    i want a ahref on page1.html to point to go to an anchor within the iframe page2.html, i have tried a few ways but didnt have much luck

    is there an easy way to do this within the ahref tag on page1.html

    thanks for your help

    cheers
     
    nicknack, May 30, 2006 IP
  2. joelbauca

    joelbauca Peon

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    on your <a> tag in page1.html, include: target="name of iframe"
     
    joelbauca, May 30, 2006 IP
  3. nicknack

    nicknack Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks i tried that but it just reloads the main page again !?
     
    nicknack, May 30, 2006 IP
  4. z00pedup

    z00pedup Peon

    Messages:
    326
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Im also having the same problem - any luck?

    I have been told "who uses Iframes?"

    hehe
     
    z00pedup, May 31, 2006 IP
  5. meybaud35mm

    meybaud35mm Peon

    Messages:
    22
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    i am not a huge fan of iframes, but they definately have their uses. ummm... are you using the anchor extention? i.e.; yourdomain.com/visitorinfo/#35. i needed to do what your doing a while ago and it was interperated differently by different browsers, mozilla, ie, opera, netscape. let me know how you have your anchors set up and if you use server side programming to write the anchors.
     
    meybaud35mm, May 31, 2006 IP
  6. nicknack

    nicknack Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    i have this in page1
    <A HREF="#W">W</a>

    and i have this in page 2
    <a name="W"></a>.
     
    nicknack, May 31, 2006 IP
  7. AMysticWeb

    AMysticWeb Guest

    Messages:
    38
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Hi and Welcome!

    I don't recommend any type of frame, but have used an iFrame or two myself (don't tell). If you are trying to create a bookmark to a specific section when page 2 loads in the iFrame, you will have to create the bookmark on page2 first and save the page before attempting to link to it.

    If you already have the iFrame linking under control for the page then you are heading in the right direction.

    So page 1 has a link to say Widgets and you want the widget section of page2 to appear in the iFrame when clicked.

    So the bookmark HTML on page2 would be something like
    <a name="Widgets">Widgets</a>

    The link on page 1 would be something like
    http://domain.com/page2#Widgets of course directed to your iFrame.

    Honestly haven't tried this method with a bookmark so maybe different browsers will react differently.
     
    AMysticWeb, May 31, 2006 IP