Tuesday, November 08, 2011

Am I the only one to want this? Linking to any part of an HTML page

Here is a pipe dream. I would like HTML to have ability to link to any paragraph in any web page. I would like to make it so that when the user clicks the link, the page would open with the paragraph of interest at the top of the browser window.

I only know how to do it if some section of a web page has an <a name="xxxxxx"> in it. And if the page I'm linking to isn't created by me, I have no control over placement of <a name>'s in it. But is it possible to link to any element of a page? If not with HTML, then with Javascript or CSS? Can one write a Javascript that, when a user clicks on a link, will bring up the desired element of the page that has loaded? I kind of doubt it, because once a page has loaded in a browser, the scripts of the previous page stop executing, correct?

And I'm pretty sure there is no way to do this if the desired paragraph is not in any uniquely-identifiable HMTL element -- for example, if it only separated from other paragraphs with <br/>

If there is really no way to do this, I wonder if such functionality was never considered by They Who Design HTML? Has nobody ever wanted it? I wish for it when an explanation or example of something I'm writing about is buried deep in some other web page, and I know that my reader, if he/she clicks on the link, is not likely to find it quickly, or to spend much time searching for it.

I suppose one can write a third-party application that would let you mark up snippets of web pages and save them; then you could link to the paragraph on the third party website. It could provide a link to the original article, for those interested in the context. But that's an additional layer of complexity. There may even have been such a service, called iLighter; it allowed you to highlight web pages and save those highlighted snippets on its servers. I know I installed it in one of my web browsers a couple of years ago, but didn't do much with it. I had app fatigue even then (too many new web applications to try), which only got worse since. And iLighter doesn't seem to be around anymore -- I guess not too many people found it useful.

I know, I could write a Javascript that would pop up just the paragraph I want to link to, when the user's mouse hovers over the link to the article. So the user could get just the quote, but read the article for context if they'd like. Of course, this is inefficient, because the quote may change some time in the future, and somehow I would have to become aware of the change (which won't happen unless I monitor that web page every day), and modify my script. So, it's not a real solution.

No comments: