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 way like Applets or something??
If cookies won't suffice, and you have to support older browsers, then LawnChair might help: http://brian.io/lawnchair/plugins/
It's like a "Couch" but smaller, get it? Took me a few minutes ;).
And, it does work for desktop browsers, despite the blurb on the site about mobile-webkit: https://github.com/brianleroux/lawnchair/blob/master/README.md.
(But, it uses cookies as the adapter to store data for the fallback on those older browsers, most such libraries probably will, if you're not allowed to use cookies for some reason, these types of libraries might not fit the bill.)
The latest browsers are supporting HTML5 Local Storage.
If the client doesn't support HTML 5, the Google Gears plugin allows local storage.
If cookies won't suffice, and you have to support older browsers, then LawnChair might help: http://brian.io/lawnchair/plugins/
It's like a "Couch" but smaller, get it? Took me a few minutes ;).
And, it does work for desktop browsers, despite the blurb on the site about mobile-webkit: https://github.com/brianleroux/lawnchair/blob/master/README.md.
(But, it uses cookies as the adapter to store data for the fallback on those older browsers, most such libraries probably will, if you're not allowed to use cookies for some reason, these types of libraries might not fit the bill.)
We have been using YUI's local storage wrapper without any issue for quite some time. The library automatically uses best available storage option and supports almost all browsers; IE6+, Firefox2.0+, and newer Safari, Chrome and Opera.
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
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.
If you're working in Google Chrome, FSO.js wraps the asynchronous FileSystem API for you and is very easy to use.
This technology should be supported by other browsers soon.
I happened to stumble across this Wiki page that lists down a lot of persistent JS stores : https://github.com/bebraw/jswiki/wiki/Storage-libraries
© 2022 - 2024 — McMap. All rights reserved.