This section describes the Cookie and Depot objects and methods. Each section includes a brief description, repeating some of the information from Chapter 6, followed by an enumeration of each object’s methods with their arguments and return values. Both storage objects are accessed through a direct API, so the format for this entry will be structured as an API entry.
If you’d like more detailed information on the HTML 5 Database object, refer to the specification at http://dev.w3.org/html5/webstorage/#databases.
Mojo cookies are technically related to browser cookies, but with an object interface to simplify use by webOS applications. Mojo cookies typically store small amounts of data that will be used to preserve application state and related information, such as preference settings.
Calling the constructor will open the named cookie if it already exists, or if it doesn’t exist, will create it.
Constructor |
---|
new Mojo.Model.Cookie(cookieName, optionalDocument) |
The Depot object is a wrapper on the HTML 5 APIs for simple object storage and retrieval. You can store up to 1 MB of data in a depot by default. Mojo provides by a few simple functions that wrap the HTML 5 APIs to create, read, update, or delete a database.
Calling the constructor will open the named depot if it already exists, or if it doesn’t exist, will create it.
Constructor |
---|
new Mojo.Depot(options, onSuccess, onFailure) |
18.227.102.195