문제

I want a way of saving progress/values on my web page so when some one exits and comes back onto the web pages they wont lose anything. Say money for instance. I am creating a game and they earn money but if they exit and come back they will be reset back to 0.

I thought maybe cookies would be a good idea to save the values of variables? Also when they return to the web page it would need to detect the cookies and receive the values and set the variables accordantly.

how would I go about doing this, or is there an easier/better way?

도움이 되었습니까?

해결책

Cookies can't hold much information. Sounds like you want to store more.

First have a look at local storage - sample here.

Or you can consider using lawndart which is an api built on top of indexeddb and websql (for Safari). Here is a tutorial about indexed db.

다른 팁

polymer_elements for Dart offers this functionality too

  • polymer_cookie

or

  • polymer_localstorage
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top