Reputation: 12888
I am extracting content from a web page using JS/JQuery and want to write the data to a comma separated file. I know javascript doesn't really support file io and I'm trying to avoid setting up a local apache server just to process the content to a file. Is there an easier way to do this?
Upvotes: 0
Views: 227
Reputation: 10758
Still requires a webserver, but you could build a small one method web service that your js calls, then the service can write out the data.
Upvotes: 0
Reputation: 4115
There is no simple way of doing this. W3C has recently published the first draft of a File API that will make it possible, but it'll be a while until this is through and widely implemented.
Upvotes: 0
Reputation: 30414
You can have your JS create the file text in a string. Then open a new window and write the string into the new window.
Upvotes: 4
Reputation: 181460
You can write a Mozilla Extension.
PROs:
You can use JS/JQuery on the extension You can write files on the extension
CONs:
You can only use the application in Firefox (or any other Mozilla based browser).
Upvotes: 0