Re: [whatwg] alternate ids for elements

Nils Dagsson Moskopp writes:

> Julian Reschke <julian.reschke@gmx.de> writes:
> 
> > On 2014-12-03 15:02, Jukka K. Korpela wrote:
>
> > > 2014-12-03, 15:49, Julian Reschke wrote:
> > >
> > > > I have a use case where a certain location in a document can
> > > > have two anchors ...
> > >
> > > Can you elaborate on that? Why cannot you use the same id
> > > attribute value in all references to an element?
> >
> > 1.) An author-supplied anchor may change, but you want to preserve
> > existing "deep" links from other documents.
> 
> The solution seems simple to me: Do not change the anchor id, ever.

But what if the original ID used had a typo in it? Or a product name has
to change for legal reasons? It's entirely reasonable for anchors to be
‘meaningful-to-human’ IDs that are indicative of the section they are
labelling, and for section names to change over time.

For instance, Wikipedia pages have an ID for each section which is based
on the section name. Every time somebody edits a section title, the
anchor changes ... and any external links specifically to that section
break.

There are far too many broken links on the web of this form, where the
link goes to the correct page but includes a non-existent anchor. Quite
often the intended section is still on the page, just with a new anchor.
Letting sites keep old anchors working would be a benefit for users
following external links to them.

> Alternatively, wrap the element in a div with a new id.

Or have some JavaScript which checks for known alternative anchors and
replaces them with their canonical spelling.

Smylers
-- 
http://twitter.com/Smylers2

Received on Wednesday, 3 December 2014 22:02:16 UTC