📌  相关文章
📜  html5 在 localstorage 中存储对象 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:56.649000             🧑  作者: Mango

代码示例2
var testObject = { 'one': 1, 'two': 2, 'three': 3 };

// Put the object into storage
localStorage.setItem('testObject', JSON.stringify(testObject));

// Retrieve the object from storage
var retrievedObject = localStorage.getItem('testObject');

console.log('retrievedObject: ', JSON.parse(retrievedObject));