2

How can I save a range (based on user selection) and reload it the next time the user visit my page again?

Details: the user selects a portion of text and I highlight it with a span. Now I have to save the "coordinates" of the selected text, so the next time the user visits my page, I'll load the range coordinates from my db and highlight the text with a span.

2 Answers 2

1

Take a look at the Rangy library. It will do what you want, and more. You can take a look at the Serializer module and also the Highlighter module (this module is still in alpha, and so it may be unstable).

0

Some similar answers:

Also (self-promotion alert) you could try Rangy's highlighter module.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.