Every line of 'get localstorage value in php' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
311 function getLocalStorage (currentControl, key) { 312 if (key in store) { 313 const stored = store[key]; 314 if (!stored) return undefined; 315 if (currentControl.type !== stored.type) return undefined; 316 if (currentControl.value !== stored.defaultValue) return undefined; 317 // console.log('CHECK CHECK', key, currentControl.value, stored.defaultValue) 318 return stored.value; 319 } 320 return undefined; 321 }
256 function getLocalData(key) { 257 if (window.localStorage) { 258 return window.localStorage.getItem(key); 259 } 260 }
39 function getValueFromLocalStorage() { 40 if (typeof localStorage === "undefined") { 41 return null; 42 } 43 const storedValue = localStorage.getItem(key) || "null"; 44 try { 45 return JSON.parse(storedValue); 46 } catch (err) { 47 console.error(err); 48 } 49 return storedValue; 50 }
163 function getLocalStorageStr(key, defaultValue) { 164 return window.localStorage[key] || defaultValue; 165 }
52 function get(name) { 53 if (typeof (Storage) !== 'undefined') { 54 return localStorage.getItem(name) 55 } else { 56 window.alert('Please use a modern browser to properly view this template!') 57 } 58 }
38 function getLocalStorage(key) { 39 return localStorage.getItem(key); 40 };
36 export function L_getValue(key) { // 个别用户禁用本地存储会报错 37 try { 38 return localStorage.getItem(key); 39 } catch (e) {} 40 }
117 function getLocalStorageItem(key) { 118 try { 119 return JSON.parse( 120 window.localStorage.getItem(key) 121 ); 122 } catch (e) { 123 return null; 124 } 125 }
34 getLocal(key: string): any { 35 const data = window.localStorage.getItem(key); 36 if (data) { 37 return JSON.parse(data); 38 } else { 39 return null; 40 } 41 }
29 function getLocal(key, fallback = undefined) { 30 const itemRaw = localStorage.getItem(key); 31 return itemRaw === null ? fallback : JSON.parse(itemRaw); 32 }