How could I use AJAX to create a Json data source .txt file?

Posted by Adam on Stack Overflow See other posts from Stack Overflow or by Adam
Published on 2010-05-02T22:33:59Z Indexed on 2010/05/02 22:37 UTC
Read the original article Hit count: 195

Filed under:
|
|

I'm creating a form that collects standard information about customers. When the user hits save, I would like to create a .txt file that would be used to later retrieve all of the data collected from customers. I'm using DataTables which is a jQuery plugin to display the data. The .txt file would be formatted to be saved as such:

{ "aaData": [
["client 1 name","address","city","state","zip"],
["client 2 name","address","city","state","zip"],
["client 3 name","address","city","state","zip"],
...
["client x name","address","city","state","zip"]
] }

Where "aaData": is used by DataTables. This is going to part of an iPhone app, so the data source has to be very small and not reliant on a constant connection to a server, so, essentially, a client-side data source. The .txt file has to also be updated when edited and saved, and then replaced every time it is downloaded.

© Stack Overflow or respective owner

Related posts about JSON

Related posts about AJAX