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:
but neither worked,because it is not plain text has html brands.
Text is a html in a div on my website
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);
Text is a html in a div on my website
Comment