By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,700 Members | 1,473 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,700 IT Pros & Developers. It's quick & easy.

Save annotations into database

P: 1
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.deserializeSelection () and rangy.SerializeSelection () 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:

Expand|Select|Wrap|Line Numbers
  1. var srcObj = document.getElementById ("tam");
  2. var rangeObj = document.createRange ();
  3. rangeObj.selectNodeContents (srcObj);
  4. var textNode = rangeObj.firstChild;
  5. rangeObj.setStart (textNode, 1);
  6. 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
Sep 29 '12 #1
Share this Question
Share on Google+
1 Reply


gits
Expert Mod 5K+
P: 5,390
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?
Oct 1 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.