1BLANKSPACE JAVASCRIPT NAMESPACE
|
.cache | Uses the in-browser HTML5 DOM storage objects, sessionStorage & localStorage. | ||
.init | |||
.exists | > persist: true/false | ||
< true / false | |||
ns1blankspace.util.local.cache.exists() | |||
.context | > userContext: true/false | ||
> key: | |||
< contextualised key | |||
ns1blankspace.util.local.cache.context() | |||
.save | > key: | ||
> data: | |||
> protect: true/false - encrypt the data - requires the util.protect namespace. | |||
> persist: true/false | |||
ns1blankspace.util.local.cache.save({key: 'Key1', data: 'Data1'}) ns1blankspace.util.local.cache.save({key: 'Key2', data: 'Data2', persist: true}) |
|||
.search | > key: | ||
> persist: true/false | |||
> json: true/false, if key: ends with .json then this is set to yes | |||
< data, as string or JSON object | |||
ns1blankspace.util.local.cache.search({key: 'Key1'}) ns1blankspace.util.local.cache.search({key: 'Key2', persist: true}) |
|||
.remove | > key: | ||
> persist: true/false | |||
> all: true/false | |||
ns1blankspace.util.local.cache.remove({key: 'Key1'}) ns1blankspace.util.local.cache.remove({key: 'Key2', persist: true}) |
1blankspace namespace |
HTML sessionStorage & localStorage |