打开 js 变量的保存文件对话框
在我的网络应用程序中,我需要为用户提供将 js 变量保存为文件的选项(当用户单击下载时,应用程序会要求他保存文件,最好是保存为 .js 文件)。
与谷歌文档类似,您可以保存文件。
javascript可以通过这种方式传递它的变量吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看 Downloadify ,它完全允许这样做。
不过,它需要在用户浏览器中安装 Flash 才能工作。
我知道没有其他方法可以在没有服务器交互的情况下做到这一点。
Check out Downloadify which allows exactly this.
it requires Flash installed in the user's browser to work, though.
I know of no other way of doing this without server interaction.
您可能还想查看 OpenSave:
http://www.gieson.com/Library /projects/utilities/opensave/
...看起来很像 Downloadify,但似乎有一些额外的功能(而且没那么复杂?)。
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?).