📜  本地存储 ha - Javascript 代码示例

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

代码示例1
function set(){
    var sendJson = JSON.stringify(allPerfume);
    localStorage.setItem("allPerfume", sendJson);
}

function get() {
    var getJson = localStorage.getItem("allPerfume")
    if (getJson) {
        allPerfume = JSON.parse(getJson);
    }
}