Browser Storage can take the following forms: - Session Storage
- Local Storage
- Database Storage
Web Storage is a separate specification from HTML 5. Currently Web Storage is supported in Firefox, Chrome and Safari but certain things are not supported in some of these browsers.
Local Storage is available on Firefox, Safari and Chrome. We found it the easiest data store to use in the whole computer science. The following is how the local storage is used: - Storing any data
- localStorage.setItem(String key, Any Data)
- localStorage.<key> = <data>
- eg. localStorage.company = "SKJ"
- Retrieving any data
- localStorage.getItem(String key)
- localStorage.<key>
- eg. alert(localStorage.company)
- Deleting any data
- localStorage.removeItem(String key)
Reference: |