0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'add' / 'put'
-
11 Agustus 2012 22:45
Hi,
When I used the following line, I got the error like:
0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'add' .
I am using :
<script src="//Microsoft.WinJS.1.0.RC/js/base.js"></script>
<script src="//Microsoft.WinJS.1.0.RC/js/ui.js"></script>Any ideas about it? Thanks a lot.
IDBObjectStore.add("value", "key");
Semua Balasan
-
14 Agustus 2012 15:17Moderator
Hi
These is a W3C Indexed Database API, it's state is draft.
Your code can't work in normal html app, it's not a Win8 UI problem.
Please refer to this :
http://www.w3.org/TR/IndexedDB/#widl-IDBObjectStore-add-IDBRequest-any-value-any-key
addThis method throws a
DOMExceptionof type ReadOnlyError if the transaction which this IDBObjectStore belongs to is has its mode set to"readonly". If any of the following conditions are true, this method throws aDOMExceptionof type DataError:- The object store uses in-line keys and the <var>key</var> parameter was provided.
- The object store uses out-of-line keys and has no key generator and the <var>key</var> parameter was not provided.
- The object store uses in-line keys and the result of evaluating the object store's key path yields a value and that value is not a valid key.
- The object store uses in-line keys but no key generator and the result of evaluating the object store's key path does not yield a value.
- The <var>key</var> parameter was provided but does not contain a valid key.
Otherwise this method creates a structured clone of the <var>value</var> parameter. If the structure clone algorithm throws an exception, that exception is rethrown. Otherwise, run the steps for asynchronously executing a request and return the
IDBRequestcreated by these steps. The steps are run with thisIDBObjectStoreas <var>source</var> and the steps for storing a record into an object store as <var>operation</var>, using thisIDBObjectStoreas <var>store</var>, the created clone as <var>value</var>, the <var>key</var> parameter as <var>key</var>, and with the <var>no-overwrite flag</var> flag set to true.Parameter Type Nullable Optional Description value any✘ ✘ The value to be stored in the record key any✘ ✔ The key used to identify the record Exception Description DOMException TransactionInactiveErrorThe transaction this IDBObjectStorebelongs to is not active.ReadOnlyErrorThe mode of the associated transaction is "readonly".DataErrorThe calculated key for the insertion was not a valid key. Also thrown if the calculated key for any of the indexes which belong to this object store had a calculated key which was not a valid key InvalidStateErrorOccurs if a request is made on a source object that has been deleted or removed. DataCloneErrorThe data being stored could not be cloned by the internal structured cloning algorithm. Return type:IDBRequest- Ditandai sebagai Jawaban oleh Dino HeModerator 31 Agustus 2012 6:52