问题
Are there any frameworks or API to store data client side conveniently, by transferring from database, during user's session ? I'm looking for any framework so that I dont have to, perhaps, care about whether or not the browser support LocalStorage
or other storage technologies & I can seamlessly store data!?
For my personal use case, I need to be able to pass an unfiltered list of recommended items for user & remove the ones he has added to his lists. I want to store the user's lists client side and then filter the unadded items.
回答1:
Lawnchair abstracts away the various storage mechanisms available via a series of adapters. It can utilize localStorage, indexedDB, web SQL, and more.
回答2:
you can use jQuery .data() or jQuery.data()
回答3:
Client side storage libraries- Automatically choose storage based on browser
http://amplifyjs.com/ - is a good option
http://pablotron.org/software/persist-js/
http://code.google.com/p/jquery-jstore/
回答4:
you can check Lungo is a Mobile HTML5 Framework, you can find your Data API really interesting.
回答5:
You can find a ton of them at microjs.com
For example, Artemia
回答6:
Have a look at YUI's StorageUtility. The YUI StorageUtility is a nice abstraction
The Storage Utility provides a mechanism for storing significant amounts of textual data, client-side, whether or not your browsers supports the proposed HTML 5 Storage specification.
Each instance of the Storage Utility leverages one of three storage engines in order to store data:
HTML 5: If the client browser supports HTML 5, then this engine will wrap the browser's native storage capability (document.localStorage and document.sessionStorage).
Google Gears: Google Gears is a browser extension that users can install on their machine. One of its features is a SQLite database; the Storage Utility uses this database for client-side storage when using the Gears engine.
SWF: YUI provides a SWFStore Utility that normalizes access to the Flash Shared Object. This is the Storage Utility's fallback engine, which will work on most browsers due to the significant penetration of the Adobe Flash plugin.
来源:https://stackoverflow.com/questions/9207249/frameworks-to-store-data-client-side