Reputation: 912
I need a database storage system for Javascript where the state can be maintained on the local disk.
Here comes the spanners in the works :-
Does anyone know of any solutions that might help here?
Upvotes: 2
Views: 987
Reputation: 169383
Have fun playing with userData. Apparently it does what you want in IE6/7
Then localStorage for IE8/9
Or you can use the heavier store.js which does the feature detection for you and apparently works in IE6+.
It should work in IE9 but no garantuees. I would recommend store.js as it's easier for maintenance and just works out of the box. You can also support other browsers that way.
Upvotes: 2
Reputation: 1835
I would suggest that you not try to read/write using JavaScript but instead head down the road of embedding a small web server on the USB drive. I did this for an app once and it worked out well. I used the Cassini web server.
I created two projects in visual studio. First, I created an ASP.Net web site to read/write from an SQLite database. This site displayed all my content and was built just like any other ASP.Net site. Second, I created a Windows Forms application that hosted the Cassini web server and presented the user with a form that contained a single web browser control. This made the user experience very simple ... they just clicked MYAPP.EXE from the root of the USB drive and the form opens, starts the web server, and navigates the browser control to the start page of the web site.
Upvotes: 1
Reputation: 38745
For strictly local IE work use HTA Applications. Then you can access local resources (text files, ADO databases) without security problems.
Upvotes: 2
Reputation: 6851
try to read this post: Read/write to file using jQuery
Hope this helps.
Upvotes: 1
Reputation: 359786
I don't know if it's supported in IE6, but JScript appears to have some level of support for this through FileSystemObject
.
var fso = new ActiveXObject("Scripting.FileSystemObject");
var a = fso.CreateTextFile("c:\\testfile.txt", true);
a.WriteLine("This is a test.");
a.Close();
According to Write binary data with FileSystemObject write(), ADODB.Stream
appears to be an alternative.
Upvotes: 2