HTML "a name" question from third party site - Query

Discussion in 'HTML' started by Miles Davenport, Oct 22, 2003.

  1. I am getting confused about HTML "a name".

    I have a webpage "foo.html, and have:

    <a name="5xp">

    In the html, if I click on a link on that page - it works fine.

    BUT, if I try and refer to the a name from another site:

    <A href="http://www.mysite.com/page.html?5xp>clickHere</A> - It doesn't
    refer to the aname, but always goes to the top of the page.

    Can someone please tell me what I am doing wrong.

    Many thanks.

    Miles.
     
    Miles Davenport, Oct 22, 2003
    #1
    1. Advertising

  2. Miles Davenport wrote:

    > <a name="5xp">
    > BUT, if I try and refer to the a name from another site:
    >
    > <A href="http://www.mysite.com/page.html?5xp>clickHere</A> - It doesn't
    > refer to the aname, but always goes to the top of the page.


    The ? indicates the begining of the query string, not the fragment
    identifier. Try # instead.

    --
    David Dorward http://dorward.me.uk/
     
    David Dorward, Oct 22, 2003
    #2
    1. Advertising

  3. Miles Davenport

    picayunish Guest

    Miles Davenport wrote in
    news:nGzlb.1055$:
    > I am getting confused about HTML "a name".
    >
    > I have a webpage "foo.html, and have:
    >
    > <a name="5xp">
    >
    > In the html, if I click on a link on that page - it works fine.
    >
    > BUT, if I try and refer to the a name from another site:
    >
    > <A href="http://www.mysite.com/page.html?5xp>clickHere</A> - It doesn't
    > refer to the aname, but always goes to the top of the page.


    Change ?5xp of the link into #5xp.
    Like this <a href="http://www.mysite.com/page.html#5xp">Jump to line xx of
    xx page.</a>
    --
    Edwin van der Vaart
    http://www.semi-conductor.nl/ Links to Semiconductors sites
    http://members.chello.nl/e.vandervaart/ Experimental site
     
    picayunish, Oct 22, 2003
    #3
  4. Miles Davenport wrote:

    > I have a webpage "foo.html, and have:
    > <a name="5xp">


    What David said, but also the modern way of specifying fragments is to use
    for example:

    <h2 id="part2">Part 2</h2>

    or

    <table id="salesfigures">.....</table>

    or

    <p id="copyrightnotice">&copy; Me 2003.</p>

    And then link to them like:

    <a href="essay.html#part2">Part 2</a>

    or

    As you can see from our <a href="finances.html#salesfigures">huge
    profits</a>, our company is a great investment...

    or

    Take a look at the <a href="about.html#copyrightnotice">fine print</a>.

    This should work in all 5.x, 6.x and 7.x browsers, and even in Internet
    Explorer 4.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?id=132
     
    Toby A Inkster, Oct 22, 2003
    #4
  5. Miles Davenport

    Sid Ismail Guest

    On Wed, 22 Oct 2003 19:06:17 +0100, "Miles Davenport"
    <> wrote:

    : <a name="5xp">
    :
    : In the html, if I click on a link on that page - it works fine.
    :
    : BUT, if I try and refer to the a name from another site:
    :
    : <A href="http://www.mysite.com/page.html?5xp>


    What's the ? for ? Use the hash #.

    Sid
     
    Sid Ismail, Oct 22, 2003
    #5
  6. Thanks for the help :)
    "Miles Davenport" <> wrote in message
    news:nGzlb.1055$...
    > I am getting confused about HTML "a name".
    >
    > I have a webpage "foo.html, and have:
    >
    > <a name="5xp">
    >
    > In the html, if I click on a link on that page - it works fine.
    >
    > BUT, if I try and refer to the a name from another site:
    >
    > <A href="http://www.mysite.com/page.html?5xp>clickHere</A> - It doesn't
    > refer to the aname, but always goes to the top of the page.
    >
    > Can someone please tell me what I am doing wrong.
    >
    > Many thanks.
    >
    > Miles.
    >
    >
     
    Miles Davenport, Oct 23, 2003
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kieran Benton
    Replies:
    3
    Views:
    521
    Ray Cassick \(home\)
    Sep 11, 2003
  2. Billy Porter
    Replies:
    0
    Views:
    1,038
    Billy Porter
    Jun 25, 2003
  3. Cowboy \(Gregory A. Beamer\)

    Re: Use Third Party HTML Designer

    Cowboy \(Gregory A. Beamer\), Nov 5, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    374
    Marty Cruise
    Nov 5, 2003
  4. David
    Replies:
    0
    Views:
    440
    David
    Apr 18, 2004
  5. Replies:
    10
    Views:
    164
    Denis McMahon
    Jun 10, 2013
Loading...

Share This Page