Linked Questions

854 votes
6 answers
938k views

If I didn't need localStorage, my code would look like this: var names=new Array(); names[0]=prompt("New member name?"); This works. However, I need to store this variable in localStorage and it's ...
David's user avatar
  • 14.1k
20 votes
1 answer
22k views

I have a very simple dictionary . var meta = {'foo':'1','moo':'2'} I want to store this in the local storage and retrieve it. window.localStorage.setItem("meta", meta); var meta1 = window....
Akash Deshpande's user avatar
16 votes
3 answers
42k views

How to store mycars array in localStorage Object in html5? var mycars = new Array(); mycars[0] = "Saab"; mycars[1] = "Volvo"; mycars[2] = "BMW"; localStorage.mycars=?;
Shakti Patel's user avatar
  • 3,862
8 votes
4 answers
27k views

I have localstorage working to where I can save inputs and push them to a list. Now I would like to save the list in localstorage because when I reload the list resets because of var fav = new Array();...
benjipelletier's user avatar
11 votes
1 answer
24k views

I have data being displayed in a table. I delete a row, I need to hide it until that deletion is also exposed to the backend (It is exposed only after a minute). There is also auto-refresh that ...
user2761431's user avatar
3 votes
2 answers
12k views

I save what I get from my backend to a local storage:+ async onSubmit(e){ e.preventDefault(); const {login, password } = this.state; const response = await api.post('/...
Felipe's user avatar
  • 462
3 votes
2 answers
8k views

var test = null; if(test !== null){ console.log('should not be logged in the console');//it worked } localStorage.setItem('foo',null); console.log(localStorage.getItem('foo'));//logs null if(...
Bhojendra Rauniyar's user avatar
11 votes
3 answers
482 views

I need to store an object like the one I the example below in localstorage. I need to be able to retrieve this object and edit it, then save it back into localStorage for next time. var data = {...
Jamie W's user avatar
  • 449
0 votes
3 answers
4k views

I want to update the dataId field of an object in localStorage. Object: let responseJson = { id: user.id, username: user.username, ...
Varinder Sohal's user avatar
1 vote
3 answers
5k views

I am trying to login to my user account which is saved on database and attach a token to that username with 'jwt-token'. router.post('/users/login', (req, res) => { User.authenticate()(req.body....
Claude M's user avatar
3 votes
2 answers
3k views

I am trying to save an array in localStorage but it contains functions (called promise) in an object of the array, but the problem appears when I convert array to string using JSON.stringify, ...
Jose Ramon's user avatar
3 votes
0 answers
5k views

Ok, I have to use the localStorage to store an object, and an array. However, whenever i set something, it stores a string value instead. For example: var x = [1,2,3]; localStorage["x"] = x; console....
tcooc's user avatar
  • 21.4k
-1 votes
2 answers
4k views

I am able to fetch data from an api. But my page keeps fetching the data from the api whenever the page loads. I tried to solve this issue using localStorage like below. I try to load the data ...
RoboPHP's user avatar
  • 420
3 votes
1 answer
1k views

Possible Duplicate: Storing Objects in HTML5 localStorage I'm trying to store JSON data, name & phonenumber given in two text fields and then later(after page refresh) retrieve and print the ...
Dean.V's user avatar
  • 111
0 votes
1 answer
2k views

i am creating a website that remembers your name and welcomes you back the second time you reload the page. I am storing the data in the localStorage because its better than cookies and its never ...
Liam Sperry's user avatar

15 30 50 per page
1
2 3 4 5
24