Open file save dialog for js variable

In my web application, I need to give the user the option to save the js variable as a file (when the user clicks the download button, the application prompts him to save the file, primarily as a .js file).

Just like the google docs suggests that you save the file.

Is it possible for javascript to pass this variable this way?

+2


source to share


2 answers


Check Downloadify , which allows just that.

Downloadify is a small JavaScript + Flash library that allows you to generate and save files on the fly in your browser without interacting with the server.



this requires Flash installed in the user's browser.

I don't know of any other way to do this without interacting with the server.

+2


source


You can also check OpenSave:

http://www.gieson.com/Library/projects/utilities/opensave/



... which is similar to Downloadify, but seems to have a few extra features (and not that hard?).

0


source







All Articles