Related link: http://www.snee.com/addids
(The following is the introduction from the web page at the URL shown above; see the web page for information on how to use the CGI that does this.)
In the early days of the web, you could only link to a specific
point within a web page if that point had an a element with a
name attribute. Recent releases of the Mozilla, Internet
Explorer, and Opera web browsers, however, let you link to any element that has
an id attribute. (More on this in a weblog
posting I did.) Hopefully, more and more web development tools will
start adding id attributes to more block elements; I’m
trying to get into the habit of doing it to everything I
Meanwhile, I’ve written a CGI script named addids.cgi (”add IDs”) that creates a temporary
copy of any web page you pass to it, with IDs added to block elements
so that you can create links to any block element you like in that
temporary copy. For a web page that doesn’t change much (not, for
example, the home page of a newspaper’s web site), nearly all
generated IDs will be the same every time a temporary copy is
generated. This means that you can look at a copy created by
addids.cgi, create a URL that links to a specific point within that
copy, and send that link to someone else with reasonable confidence
that it will show them the same point in the document.
A few random tests show that it works with some slick commercial sites (I linked to stories in the archives so that the examples would last longer): The BBC (“The varying hotel guests in each episode…”) , Rolling Stone (“On 1971’s Gets Next to You…” ) and a Vignette Storyserver-generated Time Magazine article (“Ethiopia: Tackling terror in East Africa.” Scroll up for slickness.) For a layout so complex that the CGI messes it up (for example, Wired) there may be a “Print” version of the same story that’s easier to link to (”Paper modeling reached the zenith…”). I found that it doesn’t always work properly with IE 6.0 under Windows, but it seems to work fine with Firebird .7, Mozilla 1.5, and Opera 6.1 under Windows and IE 5, IE 5.1, Safari 1.0 under OS X.
How did it work for you?