www.webdeveloper.com
Results 1 to 11 of 11

Thread: anchor links work in Chrome and IE8 but not firefox....

  1. #1
    Join Date
    Jul 2010
    Posts
    7

    anchor links work in Chrome and IE8 but not firefox....

    It works perfectly fine in Chrome and IE8 but not in firefox.

    There are two anchors on the page and 2 links.

    Link 1 for anchor 1 and link 2 for anchor 2.

    Here is the code:

    For anchor 1 it is:

    Code:
    <a name ="page" id="page"></a>
    
    <a href="#page">Back To Page Top</a>

    and for anchor 2 it is:

    Code:
    <a name="audio" id="audio"></a>
    
    <a href="#audio">Back To Audio Top</a>
    In Firefox link 1 leads to anchor 1. But link 2 also leads to anchor 1.

    So the problem is that link 2 leads to anchor 1, when it should be going to anchor 2. Can anyone help here?

    Please note that Im an amateur web developer

    Thanks in advance

  2. #2
    Join Date
    Apr 2008
    Posts
    190
    Do you have this up on the web somewhere? Have you run it through a validator? Most cross-browser mess ups can fixed with validation.

  3. #3
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    I think you will find that Firefox wants the A element to contain a text node.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  4. #4
    Join Date
    Jul 2010
    Posts
    7
    yes ive run it through a validator..that isnt the problem

    this is the most basic thing and firefox wants to mess people about with its silly procedures!!

    can someone help here? what is a text node?

  5. #5
    Join Date
    Aug 2007
    Posts
    3,767
    Literally that, text. A space, a letter etc.
    Better would be to put the id on the containing div, or table, or however you've laid out your page.
    Great wit and madness are near allied, and fine a line their bounds divide.

  6. #6
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    what is a text node?
    plain text, or you could use an inline element
    At least 98% of internet users' DNA is identical to that of chimpanzees

  7. #7
    Join Date
    Jul 2010
    Posts
    7
    this is painful.

    Ive tried using the div ID tags as the anchors. This works in Firefox and Chrome but not IE8!!!

    In IE8, the link simply doesn't work.

    So link 1 leads to anchor 1

    link 2 is simply dead

    anchor 1 is going to the top of the page (associated with div id), and link 2 is associated with div id in the middle of the page

    any other ideas here?

    Second point: I still don't understand what you mean by a text node. If you could just give an example of what one looks like, it will make sense.

    Thanks in advance
    Last edited by mindonedig; 07-15-2010 at 02:40 PM.

  8. #8
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    The ID in the DIVs should work. Please post a link.


    No text node:
    Code:
    <a name="foo"></a>
    Text node:
    Code:
    <a name="foo">Foo</a>
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  9. #9
    Join Date
    Aug 2007
    Posts
    3,767
    Are you in quirks mode? Use a doctype. Though I think it works either way.
    Great wit and madness are near allied, and fine a line their bounds divide.

  10. #10
    Join Date
    Jul 2010
    Posts
    7
    ALLELUIA praise the lord almighty!!! it worked!!!!

    adding the text nodes made all the difference...it now works on firefox, chrome and IE8!!!

    thank you very much everyone for all your help!!! it made all the difference to a total amateur like me!!!

    YES!!

  11. #11
    Join Date
    May 2005
    Location
    Gold Coast (MS)
    Posts
    2,207
    Also, make sure you leave no white space like in this link:
    Code:
    <a name ="page" id="page"></a>
    "

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles