JavaScript

{dialog.object}idbGetItem Method

Syntax

{dialog.object}.idbGetItem(itemName [, onSuccess [, onError]])

Arguments

itemNamestring

The item to retrieve from IndexedDB.

onSuccessfunction

A JavaScript function to call when the operation succeeds. The onSuccess function is passed a parameter, data, which is the value of the item. If the item is not found, data will be undefined.

onErrorfunction

A JavaScript function to call when the operation fails. The onError function is passed a parameter, err, which contains more information about the error.

Description

Retrieves the value for an item from IndexedDB.

Discussion

The idbGetItem() method looks up the value for an item in IndexedDB.

Example

if ({dialog.object}.idbAvailable()) {
    var ok = function(data) { alert('data value: ' + data); };
    var error = function(err) { alert('data was not retrieved: ' + err); };
    {dialog.Object}.idbGetItem(key,ok,error);
}

See Also