sessionStorage中的setItem和getItem
// 儲存資料到 sessionStorage
sessionStorage.setItem(‘key’, ‘value’);
// 從 sessionStorage 獲取資料
let data = sessionStorage.getItem(‘key’);
// 從 sessionStorage 刪除儲存的資料
sessionStorage.removeItem(‘key’);
// 從 sessionStorage 刪除所有儲存的資料
sessionStorage.clear();
相關文章
- sessionStorage.setItem()Session
- sessionStorage.getItem()Session
- 05 #### `__getitem__、__setitem__、__delitem__` 支援對:物件操作物件
- python 中的 __getitem__方法Python
- sessionStorage和localStorage的區別Session
- localStorage.setItem()
- localStorage.getItem()
- localStorage和sessionStorage區別Session
- localStorage 與 sessionStorage / cookie 和 sessionSessionCookie
- cookies sessionStorage和localstorage區別CookieSession
- localStorage,sessionStorage和cookie的區別及使用SessionCookie
- storage事件中的坑,storage.setItem()無法觸發storage事件事件
- localStorage和sessionStorage原型方法新增Session原型
- localStorage和SessionStorage,Application,Cache快取SessionAPP快取
- localStorage和sessionStorage儲存封裝Session封裝
- sessionStorageSession
- localStorage、sessionStorage、Cookie的SessionCookie
- sessionStorage 用法Session
- 請描述一下cookies、sessionStorage和localStorage的區別?CookieSession
- Cookie、localStorage 和 sessionStorage 的區別及應用例項CookieSession
- cookie、sessionStorage、localStorage的區別?CookieSession
- cookie、sessionStorage、localStorageCookieSession
- sessionStorage.lengthSession
- sessionStorage.removeItem()SessionREM
- sessionStorage.clear()Session
- sessionStorage.key()Session
- cookie, sessionStorage, localStorageCookieSession
- H5本地儲存:sessionStorage和localStorageH5Session
- cookie,session,sessionStorage,localStotage的區別CookieSession
- Sessionstorage 資料共享Session
- localStorage、sessionStorage、Cookie的區別及用法SessionCookie
- Cookie LocalStorage SessionStorage對比CookieSession
- localStorage與sessionStorage 區別Session
- session與sessionStorage 關聯Session
- Yet another intro for localStorage and sessionStorageSession
- 前端存貯全家桶--cookie、sessionStorage、localStorage、和indexedDB重點合集前端CookieSessionIndex
- web本地儲存(localStorage、sessionStorage)WebSession
- 詳說 Cookie, LocalStorage 與 SessionStorageCookieSession