Uutiset:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu
Advertisement:

Default theme: Use of name attribute in <a> elements is deprecated

Aloittaja Zargony, syyskuu 21, 2005, 08:17:30 AP

« edellinen - seuraava »

Zargony

In SMF 1.1b3, the default theme uses the DTD XHTML 1.0 Transitional. However, it outputs <a> elements with only a name attribute, which is deprecated by the XHTML 1.0 standard because it's replaced by the id attribute.

In XHTML, the "name" attribute has been deprecated and replaced by the "id" attribute. If you want to keep both tags for compatibility reason, name and id, the values should be the same.
This error is generated when only the name exists and that tidy try to copy the value of the name in the id attribute. But an "id" must begin with a letter ([A-Za-z]).
Solution:

BAD         <a name="123456">...</a>
BAD         <a id="123456">...</a>

DEPRECATED  <a name="my_link">...</a>

GOOD        <a id="my_link">...</a>
GOOD        <a id="my_link" name="my_link">...</a>

References:

XHTML W3c spec: name attribute: hxxp:www.w3.org/TR/xhtml1/#h-4.10 [nonactive]
XHTML W3c spec: name and id  hxxp:www.w3.org/TR/xhtml1/#C_8 [nonactive]
ID W3C spec: hxxp:www.w3.org/TR/html4/types.html#h-6.2 [nonactive]

phil_roy

I can't seem to find the fix for this as I have the same issue in a couple of other templates?

Phil
http://www.nzmac.com
NZMac.com - Supporting the New Zealand Mac community

bloc

You should be able to use both id and name in a link, and set their values alike. The error really describes it there.

phil_roy

I have no idea what you mean sorry. I can see that name="1" and id="1" are both not acceptable according to the orginal post I have a theme that is generating a link that begins...

<a name="1" href=

This is the link on that forum for collapsing a board. When I asked if there was a fix, it is becuase I don;t knwo where to find the issue or what to change to resolve it.

Cheers,

Phil
http://www.nzmac.com
NZMac.com - Supporting the New Zealand Mac community

bloc

Sorry, i see now what you mean now. Actually the default theme should not have links with the name attribute starting with a number. Which it does now.

phil_roy

http://www.nzmac.com
NZMac.com - Supporting the New Zealand Mac community

bloc

It needs to be changed in the Souces files - BoardIndex.php. But several things need changing, as the index.php?#5 will go to category 5 - which the name is set to.

Advertisement: