1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

Linking to “Named Anchor†in another web page?

Discussion in 'Other PC Software' started by McTavish, 2007/01/21.

  1. 2007/01/21
    McTavish

    McTavish Inactive Thread Starter

    Joined:
    2005/06/24
    Messages:
    576
    Likes Received:
    1
    Hi guys, I may barking up the wrong tree here, but what I’m trying to do is have a link on one web page that takes you to a section or heading that is part way down in another page.

    I can do this with the "Named Anchor" feature from inside the same page "“ that is I can get it to jump to a point further down the page no problem. If however I take that link and put it in another page, then it only takes you to the start of the page in question and won’t jump down to the point of the named anchor.

    I’m using NVU and I can’t seem to figure this one out. Can anyone point me in the right direction? Is it something other than Named Anchors I should be looking at?

    Thanks.
     
  2. 2007/01/21
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    page2.html has a named anchor like so:
    <h3><a name= "section3 ">Section 3</a></h3>

    page1.html has a link like so:
    Have a look at <a href= "page2.html#section3" target= "_top ">Section 3</a> if you have time.

    To link to a named anchor you must append the url with the "#" symbol followed by the CASE SENSITIVE anchor name. Do NOT use spaces in names.
     

  3. to hide this advert.

  4. 2007/01/21
    McTavish

    McTavish Inactive Thread Starter

    Joined:
    2005/06/24
    Messages:
    576
    Likes Received:
    1
    Hi Tony, thanks for the help. That does indeed work, but only when the new page opens in the same Window as the link. If I set the link to open in another Window, or if I right click on it and choose 'Open in New Window' then it just takes you to the top of the page. Is there a way to have it go to the anchor point no matter how you choose to open the page?
     
    Last edited: 2007/01/22
  5. 2007/01/21
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    Your test page works just fine for me. It should work no matter the link target, _top, _new, _blank, _self.

    The anchor does not appear at the top of my browser window because the page is not near long enough. A browser cannot display the target anchor beyond the length of a page, thus to get the anchor at the top of the browser window there needs to be a "full browser window" of content beneath an anchor.

    Have a look at my test that duplicates yours:
    http://members.cox.net/tonyt/target/page1.html

    If this does not work for you then clear the browser cache, you may be viewing cached files instead of newly edited files. Also, some web editors use the docs & settings/username/local settings/temp dir to store page views while editing. Delete the contents of that temp dir too.

    I never tried NVU, I now do all my coding by hand in a text editor.
     
    Last edited: 2007/01/21
  6. 2007/01/22
    McTavish

    McTavish Inactive Thread Starter

    Joined:
    2005/06/24
    Messages:
    576
    Likes Received:
    1
    Well Tony, your test links are doing the same with me as my own are. The first two will go to the anchor point if reusing the link’s window, but opening in a new window does not work. The last two automatically open a new window, but again not to the anchor but just to the top of the page. I’ve tried everything you have suggested with no joy. Perhaps it’s something to do with my system but I can’t imagine what it could be.

    Does the link on my test page http://www.multibooters.co.uk/thelink.html now automatically open a new window and take you to the anchor? If so I will be happy with that, because it must just be me.

    How about direct from here? This does not work for me either.
    http://www.multibooters.co.uk/linktest.html#howtodoit
     
  7. 2007/01/23
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    Bothe work in FF and in IE just fine! Definitely sounds like a browser issue.
     
  8. 2007/01/24
    McTavish

    McTavish Inactive Thread Starter

    Joined:
    2005/06/24
    Messages:
    576
    Likes Received:
    1
    Thanks Tony, that's all I needed to know.
     
  9. 2007/01/24
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    just curious, what size monitor & screen resolution are you using?
     
  10. 2007/01/24
    McTavish

    McTavish Inactive Thread Starter

    Joined:
    2005/06/24
    Messages:
    576
    Likes Received:
    1
    Just a 17" CRT set at 1024 x 786
    As luck would have it I don’t have anything else set up at the moment that I can try it on. It’s all packed away for a house move next week.
     
  11. 2007/01/24
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    I also use 1024x768. I wanted to verify there were enough <br> tags in the test pages.

    I am thinking that you could have a corrupted History dir. If you scroll halfway down any page and click any link, will your Back button take you back to that same point halfway down the page? If not, the History function is somehow corrupted.

    This may help, delete the entire TIF, Cookies & History dirs along w/ all sub dirs and files. They will get recreated auto by Windows next time IE is launched. However, you cannot do this while explorer.exe (desktop) is running, so save the below as as cleanup.cmd and double click it.
    Code:
    taskkill /f /im explorer.exe
    RD /S/q  "%UserProfile%\Local Settings\Temporary Internet Files "
    RD /S/q  "%UserProfile%\Cookies "
    RD /S/q  "%UserProfile%\Local Settings\History "
    RD /S/q  "%UserProfile%\Recent "
    RD /S/q   "%UserProfile%\Local Settings\Temp\ "
    MD  "%UserProfile%\Local Settings\Temp\ "
    pause
    start explorer.exe
     
  12. 2007/01/26
    McTavish

    McTavish Inactive Thread Starter

    Joined:
    2005/06/24
    Messages:
    576
    Likes Received:
    1
    History thing seems to be fine Tony as it does return to the middle of a page ok with the back button. Already tried clearing everything out but also tried your cmd and still no joy. It won’t be a glitch as I run clones of an unused install, so I basically go back to a fresh install every few weeks, and already tried a new clone.

    XP is well stripped down and browsing privacy is my priority so no doubt it is something in my setup. Not bothered with trying to cure it now as I’m upgrading shortly. Thanks for your efforts.
     
  13. 2007/01/26
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    Understood. When do the new install on the next system, periodically test that functionality of the browser while making system adjustments to determine what change affects that browser function.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.