Skip to content
afree edited this page Jul 18, 2013 · 4 revisions

jsPaint has a very basic admin class. aim is to save and load all the beautiful art created in jsPaint.

We intend to use HTML 5 Web Storage to hold all data.

This is what we found out about Weg Storage so far:

  • differentiates local and session data

source: http://en.wikipedia.org/wiki/Web_storage http://www.mediaevent.de/javascript/web-storage.html

LOCAL STORAGE

  • persistent (while browser is closed)
  • accessible for the whole domain (across sessions, tabs etc.)

source: http://t3n.de/news/html5-local-storage-daten-offlinebetrieb-speichern-350314/

syntax: // Store value on the browser beyond the duration of the session localStorage.setItem('key', 'value');

// Retrieve value (works even after closing and re-opening the browser)
localStorage.getItem('key');

// Delete Value
localStorage.removeItem('key')

// Empty the Database
localStorage.clear();

SESISON STORAGE:

  • last only during the session (i.e. as long as the browser tab is open)
  • only accesible from within the tab

source: http://www.mediaevent.de/javascript/session-storage.html

syntax: // Store value on browser for duration of the session sessionStorage.setItem('key', 'value');

// Retrieve value (gets deleted when browser is closed and re-opened)
sessionStorage.getItem('key');

// Delete Value
sessionStorage.removeItem('key')

// Empty the Database
sessionStorage.clear()
Clone this wiki locally