JavaScript

{dialog.object}idbLength Method

Syntax

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

Arguments

onSuccessfunction

A JavaScript function to call when the operation succeeds. The onSuccess function is passed a parameter, data, which is the number of items in IndexedDB.

onErrorfunction

A JavaScript function to call when the operation fails.

Description

Counts the number of items in IndexedDB.

Discussion

The idbLength() method returns a count of the number of items in IndexedDB.

Example

if ({dialog.object}.idbAvailable()) {
    var ok = function(data) { alert('number of keys:' + data)};
    var error = function() { alert('could not get number of keys')};
    {dialog.Object}.idbLength(ok,error);
}

See Also