Local Storage - Servoy/webstorage GitHub Wiki
Local Storage API allow to persist key-value pairs into the HTML5 Local Storage available in all modern Browsers.
The local storage content is persisted in the Browser across user's sessions; it can store up to 10 MB.
var KEY_SEARCHTEXT = "key.searchtext"; var searchText; // save the search text in localStorage plugins.webstorageLocalstorage.setItem(KEY_SEARCHTEXT, searchText); // the saved search text can be retrieved during the next user's session searchText = plugins.webstorageLocalstorage.getItem(KEY_SEARCHTEXT);
Event | Params | Return | Description |
---|---|---|---|
setItem | key:String, value: String | Sets an item based on a key name and value. | |
getItem | key:String | Returns the value of an item based on a key name. | |
removeItem | key:String | Removes an item based on a key name. | |
clear | Clears the entire local storage. | ||
getLength | Number | Returns the length based on the amount of items. | |
key | index:Number | Returns the name of a key based on an index. |