Search code examples
javascripthtmlbookmarks

How can I bookmark a specific row of an HTML page? (should work in chrome and if possible IE)


I'm reading stuff online from a site that prints out to HTML ebooks.

I don't want to download anything or convert anything, but i want to bookmark the current row i'm at in such a way that when i click the bookmark, i want to be taken to the respective row (not just the page).

The site contains just text, so i can't do the trick with the "#" like www.wikipedia.org/article#subchapter

(my apologies for the noobish language, i'm a junior dev, worked in Java and ABAP, but no experience in web related stuff)

I imagine i could save bookmarks that are actually Javascript code, that take me to the speciffic line, but wouldn't know where to begin, not being a web guy.

Any ideas (or implementations) would be awesome.

Thx, you guys rule.

[EDIT] Could also work AFAIK if my bookmark saved a part of the text, and then i'd get taken to that text when clicking the bookmark

[EDIT]

http://gutenberg.spiegel.de/buch/2095/2 This is basically the site. don't mind the german.


Solution

  • You could write a little chrome extension that inserts a tag every 100 words. Then you could in fact use the # syntax you referenced.

    Inserted into HTML**:

    <a name="line40" />
    

    Your bookmark

    <a href="page.html#line40">bookmark</a>
    

    **Note: with HTML5 use a tag with "ID" instead of anchors with "name" attribute.