javascript - How to save a highlighted html text for later use? -


I am trying to save the highlight text in a web page so that when the user logs in, then that same highlight

1) Get offset and node description from the selected text using the window .getSelection () method.

2) Save them in a database.

3) Use saved details and highlight the text while logged in to the user again.

After researching other sites and stack exchanges, I found that I can dynamically highlight a text by creating a range object for which the node is needed and the following code as the parameter of the offset number Not in.

  Miscellaneous category = document. CreateRange (); Range.setStart (startNode, start_offset); // node and offset parameters are provided in range .setEnd (endnode, and_offset);  

Now, when the user selects the text, then I can extract the starting and closing offset of the selected text using the window.getSelection () method. But I could not remove the node details.

I did not know how to remove node descriptions and save it in a file or cookie so that I can highlight it when the user reopens the browser , Then rewrite the same text.

I tried to find out the best in internet and stack exchanges but no site was giving way to solution to save node information.

Please help me find a solution so that this work is also useful to other people.

Thanks in advance.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -