jQuery plugin to save textareas in localStorage to prevent accidental data loss
JavaScript
Switch branches/tags
Nothing to show
Pull request Compare This branch is 6 commits behind micho:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
example
README.md
jquery.localStorageTextareas.js

README.md

localStorage memory for textareas

By Pablo Villalba for Teambox collaboration software.

Usage

Saves textareas to localStorage when the data-save-id attribute is defined as a unique string identifier for that textarea.

<textarea data-save-id="task-123"></textarea>
  • Typing on a textarea will save its value locally every 200 ms.
  • Clicking on an empty textarea will load the saved value if there is one.
  • Calling $(selector).loadSavedTextareas() will restore textareas saved.

READ THE CODE to understand how it works, it's not so long :)

Notes

  • Depends on underscore.js, jQuery 1.7.
  • You will need to manually clear localStorage if you need it.

Licence

MIT Licence, do whatever you want with it :)