first commit
This commit is contained in:
11
src/static/js/localStorageAssist.js
Normal file
11
src/static/js/localStorageAssist.js
Normal file
@@ -0,0 +1,11 @@
|
||||
function ccn_localstorageAssist_Get(index, defaultValue) {
|
||||
var cache = localStorage.getItem(index);
|
||||
if (cache == null) {
|
||||
ccn_localstorageAssist_Set(index, defaultValue);
|
||||
return defaultValue;
|
||||
} else return cache;
|
||||
}
|
||||
|
||||
function ccn_localstorageAssist_Set(index, value) {
|
||||
localStorage.setItem(index, value);
|
||||
}
|
||||
Reference in New Issue
Block a user