Best way to store data locally as key value pair.


  • i am developing a windows 8.1 html5/js app, i am trying to store data locally using localStorage.setItem("highscore", score); but it's not working, is there any better alternative to this or am i doing anything wrong?, once the data is stored it should not get deleted or expired unless the user uninstalls his app, any suggestions to achieve this?
    Friday, April 10, 2015 2:04 PM

All replies

  • What are you doing and in what way does it not work?

    Local Settings are probably appropriate for this. See https://msdn.microsoft.com/en-us/library/windows/apps/Hh465118(v=win.10).aspx

    Friday, April 10, 2015 2:09 PM
  • it doesn't show up a value but the same file when run using google chrome it's working fine.
    Friday, April 10, 2015 3:52 PM
  • Take a look at the local settings documentation I linked.

    If you need more help you'll need to provide clearer information about your goal, what you're trying to do to achieve it, and exactly how what you are doing is failing.

    Friday, April 10, 2015 7:24 PM
  • i am using html5 local storge in my app to store high score of player in the game, i am initializing the highscore to zero when the app starts but when ever the user score is greater than previous highscore value then the user highscore is updated with his present score, everything is working now but each time when app loads the highscore is set to zero, how can i make it to initialize only once i.e when the user installs my app & opens it, i don't want to initialize it each time when user opens the app.
    Saturday, April 11, 2015 8:32 AM