Discount Perfume - Find jobs - Debt Consolidation - Debt Consolidation - Free Ecards

PDA

View Full Version : Problem with "name" tag and validation


influx08
Feb 18th 2009, 11:45 am
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 (http://validator.w3.org/check?uri=http%3A%2F%2Fwww.bigfreelcdtv.co.uk%2F&charset=(detect+automatically)&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.606)

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

Any help would be greatly appreciated.

gnp
Feb 18th 2009, 5:14 pm
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

influx08
Feb 19th 2009, 12:19 am
id works perfectly thank you!!

Now fully validated!!

Thanks very much

dimitar christoff
Feb 19th 2009, 2:49 am
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.

gnp
Feb 19th 2009, 3:21 am
well.. it seems that was always the case.

source: http://www.w3.org/TR/REC-html40/struct/links.html
The destination anchor of a link may be an element within an HTML document. The destination anchor must be given an anchor name and any URI addressing this anchor must include the name as its fragment identifier.

Destination anchors in HTML documents may be specified either by the A element (naming it with the name attribute), or by any other element (naming with the id attribute).

just found this out, prompted from your observation..