GregH
GregH

Reputation: 12888

Writing to a file

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

Answers (4)

µBio
µBio

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

Thomas Kappler
Thomas Kappler

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

Scott Saunders
Scott Saunders

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

Pablo Santa Cruz
Pablo Santa Cruz

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

Related Questions