jquery - JavaScript Temporary Storage - Stack Overflow

I am writing a Quiz Application and require JavaScript mechanisms to temporarily store data without uti

I am writing a Quiz Application and require JavaScript mechanisms to temporarily store data without utilizing MySQL or an Internet Connection. The Game is a Standalone application. What techniques or libraries may be useful for such an application to store game data temporarily in the particular instance of running the JS functionality.

Please provide any references that may be useful.

Much appreciated

I am writing a Quiz Application and require JavaScript mechanisms to temporarily store data without utilizing MySQL or an Internet Connection. The Game is a Standalone application. What techniques or libraries may be useful for such an application to store game data temporarily in the particular instance of running the JS functionality.

Please provide any references that may be useful.

Much appreciated

Share Improve this question asked Sep 25, 2014 at 2:18 MpatapoMediaMpatapoMedia 111 silver badge11 bronze badges 2
  • 3 You can use localStorage. – jpcanamaque Commented Sep 25, 2014 at 2:20
  • Just answered a similar question today: stackoverflow./a/26026430/965907 – Shomz Commented Sep 25, 2014 at 2:20
Add a ment  | 

3 Answers 3

Reset to default 3

If you don't need your data to stay after you leave the page, consider using sessionStorage.

Otherwise, you're fine with localStorage, like I said in the ment, here is a very related answer: https://stackoverflow./a/26026430/965907

You can use cookies, but localStorage is a bit more modern and provides several advantages. See https://developer.mozilla/en-US/docs/Web/Guide/API/DOM/Storage for a list of storage options in modern browsers.

localStorage and sessionStorage are very similar, and I'd suggest you just use localStorage. See HTML5 Local storage vs. Session storage for a broader discussion.

Maybe you can use javascript cookies. With them you can keep information with a name for as long as you would like. sessionStorage and localStorage are harder to understand and add to your page, but if you are an expert then you could use those. But as I said, I would remend using cookies.
Good luck with your work!

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745454295a4628413.html

相关推荐

  • jquery - JavaScript Temporary Storage - Stack Overflow

    I am writing a Quiz Application and require JavaScript mechanisms to temporarily store data without uti

    4小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信