

There are many reasons sometimes you want to store data locally to a user’s computer from a JavaScript application. JavaScript/HTML doesn’t have too much choice excepting using cookies. Of cause unless you use the more elaborate solution such Google Gear. Otherwise, the other option would be using Flash.
This Japanese dude create small JS/Flash utility you can use within a HTML/JS application to easily store local data.
You can download this utility from here. Once you unziip it you can play the test.html to see how it works.
To use it inside your application, copy these three files into you web app directory: swfobject.js ?save2local.swf ?save2local.js.
Then add these lines into your HTML page:
<script type=”text/javascript” src=”swfobject.js”></script>
<script type=”text/javascript” src=”save2local.js”></script>
After that, you can use it like this:
<script type=”text/javascript”><!–
function test() {
save2local.saveData(”key”,”value”);
alert( save2local.loadData(”key”) );
}
–></script>
<a href=”javascript:test()”>Just a test, click here .</a>
Flash allows to store 56k or more data locally by default. So you have some room here to play.
If you would like to make a comment, please fill out the form below.
Please suggest script to store data locally and access the stored values while opening a local file. The above save2local_js.zip works only online, but not from locally save file.