Problem with "name" tag and validation

Discussion in 'JavaScript' started by influx08, Feb 18, 2009.

  1. #1
    I am trying to validate my website (Strict) and have got it down to 1 error which is the name tag used in some javascript for rollover images on my site

    My site is http://www.bigfreelcdtv.co.uk
    The validation is here

    Is there an alternative to this as i have tried deleting it but the rollover images dont work.

    Any help would be greatly appreciated.
     
    influx08, Feb 18, 2009 IP
  2. gnp

    gnp Peon

    Messages:
    137
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hello,

    unfortunately in xhtml strict the name attribute for ( a, applet, form, frame, iframe, img, and map) is deprecated
    take a look : http://www.w3.org/TR/xhtml1/#h-4.10

    you should use id instead of name, and alter your scripts accordingly..
    (or use xhtml transitional)

    regards
     
    gnp, Feb 18, 2009 IP
  3. influx08

    influx08 Guest

    Messages:
    72
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    id works perfectly thank you!!

    Now fully validated!!

    Thanks very much
     
    influx08, Feb 19, 2009 IP
  4. dimitar christoff

    dimitar christoff Active Member

    Messages:
    882
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    90
    #4
    name is deprecated for a? so now you do anchor links by id? cheers - that's ignorance for you, i bury my head into transitional doctypes and never bother to find stuff like that...

    <a href="#foobar">go to foobar</a>
    something else
    something else
    something else
    something else
    <a id="foobar"></a>foobar anchor is here
    something else
    something else

    is it pseudo selector based around a#foobar? i mean - if you have

    <img id="foobar" /> instead, would it navigate to it?

    edit: lol, this works also - so basically, ANY id element is an anchor of sorts? nice.
     
    dimitar christoff, Feb 19, 2009 IP
  5. gnp

    gnp Peon

    Messages:
    137
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #5
    well.. it seems that was always the case.

    source: http://www.w3.org/TR/REC-html40/struct/links.html
    just found this out, prompted from your observation..
     
    gnp, Feb 19, 2009 IP