Resistance to client side (storage)

In my demos, I would like to avoid using traditional databases and store all the data on the client side, for example. Information submitted through the form.

What alternatives do I have for this. I heard about Gears, but I have no practical experience.

You can also save binary information except strings, for example. picture?

+6
javascript flash google-gears
source share
5 answers

You can look at YUI StorageUtility . It can use HTML 5, Google Gears or SWF on a backup basis.

+5
source share

Your options are somewhat limited, I'm afraid.

+1
source share

Cookies are the most supported way that will work in browsers. I have a small library open for receiving and saving data via Cookies through my own javascript objects.

http://code.google.com/p/mapbug/source/browse/trunk/app/scripts/cookies.js 

You can copy it and use as you wish. You will also need this javascript namespace isolation code if you use it as is:

 http://code.google.com/p/mapbug/source/browse/trunk/app/scripts/namespace.js 

If you have a lot of data, you will have to distribute it to several different cookies. Usually you can depend on the ability to store up to 4K data for each cookie.

+1
source share

YUI StorageUtility is a great abstraction, as Andy said. Dojo has a similar abstraction dojox.storage , which also works with some older browsers. If your data volume is <100 KB, then you can easily use Flash. Think about how to use HTTP cookies, as they are not only limited in size, they are sent over the wire, which may or may not be desirable.

+1
source share

I have a very simple demo for testing HTML5 webstorage / localstorage.

http://www.codebase.es/test/webstorage.html

You can store whatever you want, not just strings. To save the image, copy the image to the canvas and save the data using the toDataURL () method.

But don't expect it to work with IE ...

0
source share

All Articles