Hemi JavaScript Framework
Hemi.storage.dom
Description
A lightweight wrapper around the DOM Storage API.
static Hemi.storage.dom
version 3.1.0
A conditional wrapper exposed based on browser support.
Index
Method Index
- public clear: Empties the storage of all saved key/value pairs.
- public getItem: Returns the stored value corresponding to the specified key.
- public getLength: Returns the number of keys currently stored.
- public key: Returns the key at the specified index.
- public removeItem: Removes the specified item from storage.
- public setItem: Stores the supplied value at the specified key.
Methods
clear
Empties the storage of all saved key/value pairs.
Syntax
void clear(
)
getItem
Returns the stored value corresponding to the specified key.
Syntax
v = getItem(
n
)
Parameters
Returns
v as String: Stored value.
getLength
Returns the number of keys currently stored.
Syntax
l = getLength(
)
Returns
l as int: Number of keys.
key
Returns the key at the specified index.
Syntax
s = key(
i
)
Parameters
- i as int : Storage index.
Returns
s as String: The key name.
removeItem
Removes the specified item from storage.
Syntax
void removeItem(
n
)
Parameters
setItem
Stores the supplied value at the specified key.
Syntax
b = setItem(
n, v
)
Parameters
- n as String : Key name.
- v as String : Value.
Returns
b as bit: Bit indicating whether the value was stored.
[ Hemi JavaScript Framework - Stephen W. Cote, 2002 - 2009. ]