Reputation: 275
I am working on a small management game made with html/css and javascript. The all thing is offline, there is no server side, I only use html as a GUI.
The player should be able to save his progress, so I am looking for a way to save data on the client side. The data will be about 200/300 objects with about 10 variables in each.
Is there a way to create a “save file” or some kind of database with javascript?
Upvotes: 1
Views: 521
Reputation: 29493
The player should be able to save his progress, so I am looking for a way to save data on the client side. The data will be about 200/300 objects with about 10 variables in each.
You can save JSON
to WebStorage
Use either:
localStorage
(https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage)sessionStorage
(https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage)Upvotes: 2