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?
source to share
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.
source to share
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?).
source to share