Storage

js.html.Storage (extern class)

The Storage interface of the Web Storage API provides access to a particular domain's session or local storage. It allows, for example, the addition, modification, or deletion of stored data items.

Documentation Storage by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See:

Instance Members

length: Int

Returns an integer representing the number of data items stored in the Storage object.


key(index: Int): String

When passed a number n, this method will return the name of the nth key in the storage.

Name Type
index Int
Returns
String

getItem(key: String): String

When passed a key name, will return that key's value.

Name Type
key String
Returns
String

setItem(key: String, value: String): Void

When passed a key name and value, will add that key to the storage, or update that key's value if it already exists.

Name Type
key String
value String

removeItem(key: String): Void

When passed a key name, will remove that key from the storage.

Name Type
key String

clear(): Void

When invoked, will empty all keys out of the storage.