Persistent storage on client side

前端 未结 8 2092
故里飘歌
故里飘歌 2020-12-19 04:27

Is there any way to have some persistent data (like an XML file or so) apart from cookies at client side? I know that\'s not possible with JavaScript directly. But any other

相关标签:
8条回答
  • 2020-12-19 04:50

    Html5 local storage is definitely the answer, if you want an example on how to use this feature , check if the browser supports it and how to iterate over the items check this link: http://geoffrey.vandiest.biz/post/2011/04/30/HTML5-Local-Storage.aspx

    0 讨论(0)
  • 2020-12-19 04:54

    This is an old question, but there are some really nice newer HTML5 technologies for client-side storage worth looking into. you can do it in the javascript now.

    The File-System API and IndexedDB are definitely worth looking into and should be around to stay!

    To avoid security issues the files you store on the client machines are sandboxed and obfuscated on the client side.

    File-System API

    File-System API and for the browsers that don't yet support the File-System API there is a js you can include to get the desired functionality. You can request Temporary or Persistent Storage. The only limitation to your file size with the File-System API is the ammount of free space on the client's harddrive (coupled with the quota you request). Temporary storage within the file-system api will only get you several hundred MB max (a couple GB if you are lucky). I use double digit GBs with PERSISTENT storage for web applications with little to no issues.

    IndexedDB

    IndexedDB is a more widely browser supported technology. There are more file size limitations for indexedDB, typically you'll be able to get up to a couple hunded MB of space using Quota requests.

    0 讨论(0)
提交回复
热议问题