SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Anchors <a> IE8

  1. #1
    SitePoint Enthusiast monkey56657's Avatar
    Join Date
    Jun 2007
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Anchors <a> IE8

    Hello.

    Does anyone have any ideas why the following code would not work in IE8.

    Code:
    <a name="JumpTop" class="cAnchor"></a>
    Whether the class is removed the <a> is self close or the name is changed it still does not work on IE8. It just doesnt jump to it on page!

    Any ideas? Thanks.

  2. #2
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Maybe IE8 is (correctly) ignoring that because named anchors have been deprecated in favour of the ID attribute.

    In any case, this is a bit of a waste of time. Why don't you start thinking about your website working in IE8 when it is in a beta stage at least?

  3. #3
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,476
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Technically it is in beta, but beta releases are often used to test the program for any bugs so they can be fixed rather than the files that the program uses (in the case of the browser, the beta test is used to find any flaws in the browser itself, rather than the pages/sites that the browser uses to show to the user).

    Anyway, as this is a page coding problem, eschewing deprecated (obsolete) elements and attributes in favor of those that will pass validation with a Strict DOCTYPE will probably fix the problem you're seeing here.

    Furthermore, I'd wait to test your sites for "IE 8 compliance" until the browser reaches Candidate Release status. In the meantime, if you want to poke around and see if there's anything the browser is actually screwing up, feel free to and of course file your bug reports with the developers so they can determine if they really are bugs that need to be fixed or if it was a simple case of the page code not being written correctly (a designer/developer issue, not a browser issue).

  4. #4
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,278
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    It depends on the doctype. Apparently not only is it valid for both HTML4.01Strict but also (even though they've said it's "formally deprecated") in XHTML1.0 Strict!

    Name was supposed to be deprecated so XHTML could work via XML parsers which don't use name but use ID. But they didn't take it out of the spec (they did for XHTML1.1 and 2).

    Also, apparently this was encouraged by W3C specifically for in-page links. So it's valid, although some browsers need a space between the two tags instead of right nixt to each other.

    I know, I got the chew-down when asking why <a name="messages" /> wasn't invalid like I thought it would be. It's valid, and it works. But, ew.
    I personally wouldn't use it because it's something sitting in the page to cause a behaviour but otherwise is meaningless. So, I prefer to stick IDs on things that are already on the page doing something (a div or an <h#> tag) and have anchors link to THOSE.


Bookmarks

Posting Permissions

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