I have a .txt file that needs to be accessed offline in the browser. Ideally I would like to the page to open and different form fields display the data from each specific line.
Printable View
I have a .txt file that needs to be accessed offline in the browser. Ideally I would like to the page to open and different form fields display the data from each specific line.
Sorry, but I don't really follow your question. If you want to change a file on your hard drive from a web page javascript will not work. You can try using IE specifically to work with active x which might grant permissions to write to files.
If you want to show different information if your looking at the file offline you could try using javascript to check for internet access. There are probably a few ways, I think IE has the function onLine() or something. You could always use an ajax request to check for a connection and then show different information depending on the callback.
I'm not quite sure what your goal is...
Yes I need to edit .txt files in UI format of some kind and I thought HTML would be the best. The files will be accessed from the hard drive and need to be done so offline.
I was hoping that JS could write/read .txt files.
Is that possible?
Any alternative programming techniques?
Okay javascript does not have native support for writing files, it is not built into the dom. However, new browser have built in API's for local database support. For example, FF4 now has Indexed Database API as part of the javascript library. Other than that I am not sure how you would read/write data on your local machine using javascript.
If you really want to do this you could setup a local server running apache and php. Then you would build your web app using javascript for the ui and php to read/write your files. Additionally you could install MySQL and use database support.
Oh yea, you would try using Google Gears possibly, http://gears.google.com/ . Also, I am pretty sure actionscript supports some type of file commands. I think the adobe flex system does file management, and its written in as.