开发者

Open a save file dialog for a js variable

In my web app I need to give the user the option to save a js variable as a file (when the user clicks download开发者_如何学编程, the app offers him to save a file, preffereably as .js file).

Similarly as google docs offers you to save a file.

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


Check out Downloadify which allows exactly this.

Downloadify is a tiny JavaScript + Flash library that enables the generation and saving of files on the fly, in the browser, without server interaction.

it requires Flash installed in the user's browser to work, though.

I know of no other way of doing this without server interaction.


You might also want to check out OpenSave:

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

... which looks much like Downloadify, but seems to have a few extra features (and not as complicated?).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜