www.webdeveloper.com
Results 1 to 5 of 5

Thread: How Can I Edit a .txt file using Javascript or jQuery forms

Hybrid View

  1. #1
    Join Date
    Mar 2006
    Posts
    38

    How Can I Edit a .txt file using Javascript or jQuery forms

    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.

  2. #2
    Join Date
    Mar 2010
    Posts
    128
    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...

  3. #3
    Join Date
    Mar 2006
    Posts
    38
    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?

  4. #4
    Join Date
    Mar 2010
    Posts
    128
    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.

  5. #5
    Join Date
    Mar 2010
    Posts
    128
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles