On some websites, you can easily link to a section of the page that starts with some heading. For example, to link to the section "Site creation process" of the Wikipedia article "Stack Exchange", you can use a link like: https://en.wikipedia.org/wiki/Stack_Exchange#Site_creation_process.

On other pages, this is not possible, because the HTML elements that represent headings of the article don't have the id attribute. For example, there is no way to link to the section "Replaced by computers" of the BBC article "The end of middle management?" No link like http://www.bbc.com/capital/story/20150624-the-end-of-middle-management#replaced-by-computers or anything similar will do the right thing and jump to the correct heading.

But I believe a web app might be able to fix this. I imagine having URL like http://thewebapp.com/section_link?url=http://www.bbc.com/capital/story/20150624-the-end-of-middle-management&section=Replaced_by_computers (or http://thewebapp.com/short_link/abcdef) which would somehow link to the section of the specified web page.

Does such a web application exist?

I'm looking for a web application, because I want to send the link to others and have it just work. So a Greasemonkey user script, or a browser extension wouldn't work for me.

  • Anchors are processed in the browser, so that would require JavaScript to be injected. I very much doubt such a webapp can exists (except if it retrieves the full page and presents it itself). A userscript for that however does exist: AutoTOC is what I use, and it works fine. – Izzy Jun 25 '15 at 22:06
  • @Izzy - Unfortunately that will not work for the example given as the "heading" is not tagged as such - it uses <p><em>... rather than <Hx>.. poor authoring I know and AutoTOC works by identifying <H... tags. – Steve Barnes Jun 26 '15 at 4:56
  • 1
    @SteveBarnes Ouch. OK, in that case I very much doubt any solution does exist – except for burning that "designer" and have somebody writing "clean code"... – Izzy Jun 26 '15 at 5:23
  • Maybe pushing it through an online app that auto IDs each paragraph & header on the page then you could send a tag, or a short tag, of the format http:url_of_auto_id?url_of_original#generated_id but off the top of my head I don't know of such a service currently running. – Steve Barnes Jun 26 '15 at 5:29
  • 1
    There was a proposal, zesty.ca/crit/draft-yee-url-textsearch-00.txt to provide exactly what you are asking for back in 1998 but AFAIK no browser has implemented it. – Steve Barnes Jun 26 '15 at 20:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.