storage
is a series of apis, support add, modify and delete stored data.
::: warning There is NO same-origin-policy in weex storage moudle. Any one can access any key, even can change the value. So be careful of your usage. :::
When passed a key and a value, it will saved into the storage, or update the value if the key already exists.
When passed a key, will return that key's value.
When passed a key, will remove that key and value from the storage.
var storage = weex.requireModule('storage'); storage.removeItem('foo', function(e) { // callback. 'e' is an object that contains 'result' and 'data'. // e.result will return 'success' or 'failed' according to the executing result. // e.data will always return 'undefined' in this function if success. });
Returns an integer representing the number of key-value items stored in the storage.
Returns an array that contains all keys stored in the storage.