JavaScript Reference

Local Navigation

Offline applications API

Object

Description

Availability

ApplicationCache

Checks the status of the manifest file and updates web resources.

6.0 or later

Object: ApplicationCache

Availability

BlackBerry Device Software version 6.0 or later

The ApplicationCache object provides programmatic access to an associated manifest file. The manifest file defines the web resources that the browser must cache so that the web content can function while the BlackBerry device has no network connection. The ApplicationCache object lets you check the status of the manifest to determine whether updated resources are available and need to be downloaded, or whether the latest resources are already cached on the device.

Back To Top

ApplicationCache properties

Property name

Type

Description

Status

Support level

Availability

status

unsigned short

Returns the current state of the application cache, represented using an ApplicationCache constant.

read only

Offline Applications

6.0 or later

Back To Top

ApplicationCache constants

Constant

Status value

Description

Support level

Availability

0

UNCACHED

The object is not currently associated with an application cache.

Offline Applications

6.0 or later

1

IDLE

The application cache is idle, that is, not in the process of beign updated.

Offline Applications

6.0 or later

2

CHECKING

The application cache manifest is being retrieved and checked for updates.

Offline Applications

6.0 or later

3

DOWNLOADING

The resources specified in the application cache manifest are being downloaded.

Offline Applications

6.0 or later

4

UPDATEREADY

A new version of the application cache is available.

Offline Applications

6.0 or later

5

OBSOLETE

The application cache is obsolete.

Offline Applications

6.0 or later

Back To Top

ApplicationCache event handlers

Property name

Type

Description

Status

Support level

Availability

oncached

EventListener

Specifies the function to perform when caching of resources defined in the application cache manifest is completed.

writable

Offline Applications

6.0 or later

onchecking

EventListener

Specifies the function to perform when retrieving the application cache manifest and checking for updates.

writable

Offline Applications

6.0 or later

ondownloading

EventListener

Specifies the function to perform when the resources defined in the application cache manifest are being downloaded to the cache.

writable

Offline Applications

6.0 or later

onerror

EventListener

Specifies the function to perform when an error occurs during the caching of resources.

writable

Offline Applications

6.0 or later

onnoupdate

EventListener

Specifies the function to perform when there is no update to download.

writable

Offline Applications

6.0 or later

onobsolete

EventListener

Specifies the function to perform when the application cache becomes obsolete.

writable

Offline Applications

6.0 or later

onprogress

EventListener

Specifies the function to perform periodically while the resources defined in the application cache manifest are being downloaded to the cache.

writable

Offline Applications

6.0 or later

onupdateready

EventListener

Specifies the function to perform when new resources are available.

writable

Offline Applications

6.0 or later

Back To Top

ApplicationCache methods

Method name

Description

Support level

Availability

addEventListener()

Adds an EventListener object to a set of event listeners for the application cache.

DOM 2 Events

6.0 or later

dispatchEvent()

Dispatches an Event object created by Document.createEvent().

DOM 2 Events

6.0 or later

removeEventListener()

Removes an event listener from an EventTarget.

DOM 2 Events

6.0 or later

swapCache()

Switches to the most recent version of the cache, if it exists.

Offline Applications

6.0 or later

update()

Begins downloading the application cache resources.

Offline Applications

6.0 or later

Back To Top
Next topic: Range API

Was this information helpful? Send us your comments.