getItem( key ) method

Storage

Syntax

getItem( key ) → {string}

Parameters

Name Type Description
key string String key corresponding to the requested value.

Returns

A String value corresponding to the key, or null if either the key is not known, or if the key exists but its value was set to null.

Type:

string

Example

// Create the SUP Storage
var store = new hwc.SUPStorage ("one");
store.setItem ("foo", "bar"); // add an item.
result = store.getItem ("foo"); // will returns "bar".
result = store.getItem ("foo1"); // foo1 does not exists; will return null.

Source

SUPStorage.js, line 170.