Save annotations into database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • althenwolf
    New Member
    • Sep 2012
    • 1

    Save annotations into database

    I need to save the annotations that other people do on the website. I need to save the selections of a text HTML in a database for retrieval later. Before users can view them whenever they want. I have used rangy.deseriali zeSelection () and rangy.Serialize Selection () https://code.google.com/p/rangy/wiki/SerializerModule but when reloading the page does not work.

    I tried to create the range with the positions:

    Code:
    var srcObj = document.getElementById ("tam");
    var rangeObj = document.createRange ();
    rangeObj.selectNodeContents (srcObj);
    var textNode = rangeObj.firstChild;
    rangeObj.setStart (textNode, 1);
    rangeObj.setEnd (textNode, 1000);
    but neither worked,because it is not plain text has html brands.

    Text is a html in a div on my website
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #2
    i think i don't get the issue quite well - when and under which circumstances an annotation should be saved? when the user writes them to the webpage? then just the typed in text needs to be saved?

    Comment

    Working...