Answers for "local storage with json"

4

javascript get local storage

var Item = localStorage.getItem('youritem');
Posted by: Guest on February-22-2020
0

how to setItem and getItem in javascript in localStorage

function set(){
    var sendJSON = JSON.stringify(allMovie);
    localStorage.setItem('allMovie',sendJSON)
}

function get(){
    var getJSON = localStorage.getItem('allMovie');
    if (getJSON){
        allMovie = JSON.parse(getJSON)
    }

}
Posted by: Guest on August-10-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language